X-Git-Url: http://git.dolda2000.com/gitweb/?a=blobdiff_plain;f=daemon%2Fauth.c;h=470c985db3805ba7759d370eb6808c968009f0bc;hb=ded209d3974f3f381e718b62acf4f430dc641562;hp=c5aace04158e3d48c4f763eeeab070e069eb37d4;hpb=d9f89ef5daa6375fc4ff257826fa39562fbe3ac3;p=doldaconnect.git diff --git a/daemon/auth.c b/daemon/auth.c index c5aace0..470c985 100644 --- a/daemon/auth.c +++ b/daemon/auth.c @@ -1,6 +1,6 @@ /* * Dolda Connect - Modular multiuser Direct Connect-style client - * Copyright (C) 2004 Fredrik Tolf (fredrik@dolda2000.com) + * Copyright (C) 2004 Fredrik Tolf * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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) @@ -148,12 +155,9 @@ void regmech(struct authmech *mech) static void preinit(int hup) { - extern struct authmech authmech_pam; - if(hup) return; regmech(&authless); - regmech(&authmech_pam); } static int init(int hup) @@ -164,12 +168,10 @@ 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_BOOL, "authless", {.num = 0}}, {CONF_VAR_END} };