X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=daemon%2Fauth-unix.c;h=6f0e7c6822886ed3d69c612457465c11af7eb02b;hb=e03e1e7c23b2f527d43ec72b01c93185ebc63008;hp=9707bfd3aceaeaf2075a3daf587fc7c6fbe310ab;hpb=516eedd937505c69fef5b9f6b971f0995ab819bf;p=doldaconnect.git diff --git a/daemon/auth-unix.c b/daemon/auth-unix.c index 9707bfd..6f0e7c6 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) { - errno = EBADE; + if(sk->ucred.uid == -1) { + errno = EOPNOTSUPP; /* Bleh */ 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 = {