X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=daemon%2Fauth.c;h=83fc5aa02e21e54ee20081ed84bb1a2b4d104a70;hb=8754fb8567f5c21e9e034032d1a8abc4dab909fe;hp=0d34fbb9efa9414a63add5b506d852e6104f0333;hpb=d3372da97568d5e1f35fa19787c8ec8af93a0435;p=doldaconnect.git diff --git a/daemon/auth.c b/daemon/auth.c index 0d34fbb..83fc5aa 100644 --- a/daemon/auth.c +++ b/daemon/auth.c @@ -38,7 +38,7 @@ static void authless_release(struct authhandle *auth) { } -static int authless_authenticate(struct authhandle *auth, char *data) +static int authless_authenticate(struct authhandle *auth, struct socket *sk, char *data) { return(AUTH_SUCCESS); } @@ -112,11 +112,18 @@ struct authhandle *initauth(wchar_t *mechname, char *username) return(auth); } -int authenticate(struct authhandle *handle, char *data) +int authenticate(struct authhandle *handle, struct socket *sk, char *data) { if(handle->mech == NULL) return(AUTH_ERR); - return(handle->mech->authenticate(handle, data)); + return(handle->mech->authenticate(handle, sk, data)); +} + +int authavailable(struct authmech *mech, struct socket *sk) +{ + if(mech->available == NULL) + return(1); + return(mech->available(sk)); } int authrenewcred(struct authhandle *handle) @@ -164,7 +171,11 @@ static int init(int hup) static struct configvar myvars[] = { + /** The name of the PAM service file to use. */ {CONF_VAR_STRING, "pamserv", {.str = L"doldacond"}}, + /** Specifies whether insecure authentication is to be allowed. If + * you are not completely sure what you are doing, never turn this + * on without also turning on net.onlylocal. */ {CONF_VAR_BOOL, "authless", {.num = 1}}, {CONF_VAR_END} };