Dolda2000 GitWeb
/
doldaconnect.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanup Makefile a bit.
[doldaconnect.git]
/
daemon
/
auth-unix.c
diff --git
a/daemon/auth-unix.c
b/daemon/auth-unix.c
index
c90aba8
..
6f0e7c6
100644
(file)
--- a/
daemon/auth-unix.c
+++ b/
daemon/auth-unix.c
@@
-63,19
+63,21
@@
static int unixauth(struct authhandle *auth, struct socket *sk, char *passdata)
data = auth->mechdata;
if((pwd = getpwnam(data->username)) == NULL)
return(AUTH_ERR);
data = auth->mechdata;
if((pwd = getpwnam(data->username)) == NULL)
return(AUTH_ERR);
- if(sk->ucred.
pid == 0
) {
- errno = E
BADE;
+ if(sk->ucred.
uid == -1
) {
+ errno = E
OPNOTSUPP; /* Bleh */
return(AUTH_ERR);
}
return(AUTH_ERR);
}
- if(pwd->pw_uid == sk->ucred.uid)
+ if(pwd->pw_uid == sk->ucred.uid) {
+ 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);
return(AUTH_SUCCESS);
+ }
auth->text = swcsdup(L"Unix credentials do not match supplied user name");
return(AUTH_DENIED);
}
static int available(struct socket *sk)
{
auth->text = swcsdup(L"Unix credentials do not match supplied user name");
return(AUTH_DENIED);
}
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 = {
}
static struct authmech mechdesc = {