X-Git-Url: http://git.dolda2000.com/gitweb/?p=doldaconnect.git;a=blobdiff_plain;f=daemon%2Fauth-pam.c;h=7e51383b6f0a4c72dca305d1703f08b9ef53e88f;hp=54b18c56f70131185b8b618fd179f3561f4aad0f;hb=ded209d3974f3f381e718b62acf4f430dc641562;hpb=7ebc7902c240e0417fd0ecfc809066ff13ab293f diff --git a/daemon/auth-pam.c b/daemon/auth-pam.c index 54b18c5..7e51383 100644 --- a/daemon/auth-pam.c +++ b/daemon/auth-pam.c @@ -34,8 +34,6 @@ #include #include #include -#include -#include #include #ifdef HAVE_CONFIG_H @@ -45,6 +43,11 @@ #include "utils.h" #include "conf.h" #include "log.h" +#include "module.h" + +#ifdef HAVE_PAM +#include +#include struct pamdata { @@ -321,7 +324,7 @@ static int closesess(struct authhandle *auth) return(rc); } -struct authmech authmech_pam = +static struct authmech authmech_pam = { .inithandle = inithandle, .release = release, @@ -332,3 +335,31 @@ struct authmech authmech_pam = .name = L"pam", .enabled = 1 }; + +static int init(int hup) +{ + if(!hup) + regmech(&authmech_pam); + return(0); +} + +static struct configvar myvars[] = +{ + /** The name of the PAM service file to use. */ + {CONF_VAR_STRING, "pamserv", {.str = L"doldacond"}}, + {CONF_VAR_END} +}; + +static struct module me = +{ + .conf = + { + .vars = myvars + }, + .init = init, + .name = "auth-pam" +}; + +MODULE(me); + +#endif /* HAVE_PAM */