X-Git-Url: http://git.dolda2000.com/gitweb/?a=blobdiff_plain;f=daemon%2Fauth-unix.c;h=47a1c24b895a0ae6230d32bceb82966d5ba7f6bd;hb=a8c5ada654f0ff7b7c8bb9542fcae9c4a917f353;hp=9707bfd3aceaeaf2075a3daf587fc7c6fbe310ab;hpb=15ee5bfbd9496abdc2d03f1b77079ea4dea2ad0b;p=doldaconnect.git diff --git a/daemon/auth-unix.c b/daemon/auth-unix.c index 9707bfd..47a1c24 100644 --- a/daemon/auth-unix.c +++ b/daemon/auth-unix.c @@ -63,12 +63,12 @@ static int unixauth(struct authhandle *auth, struct socket *sk, char *passdata) data = auth->mechdata; if((pwd = getpwnam(data->username)) == NULL) return(AUTH_ERR); - if(sk->ucred.pid == 0) { + if(sk->ucred.uid == -1) { errno = EBADE; return(AUTH_ERR); } if(pwd->pw_uid == sk->ucred.uid) { - flog(LOG_INFO, "process %i successfully authenticated as %s with Unix credentials (uid=%i, gid=%i)", sk->ucred.pid, data->username, sk->ucred.uid, sk->ucred.gid); + flog(LOG_INFO, "successful authentication as %s with Unix credentials (uid=%i, gid=%i)", data->username, sk->ucred.uid, sk->ucred.gid); return(AUTH_SUCCESS); } auth->text = swcsdup(L"Unix credentials do not match supplied user name"); @@ -77,7 +77,7 @@ static int unixauth(struct authhandle *auth, struct socket *sk, char *passdata) static int available(struct socket *sk) { - return((sk->family == PF_UNIX) && (sk->ucred.pid != 0)); + return((sk->family == PF_UNIX) && (sk->ucred.uid != -1)); } static struct authmech mechdesc = {