diff --git a/src/conf.c b/src/conf.c index 2ee632b..1b12c30 100644 --- a/src/conf.c +++ b/src/conf.c @@ -558,6 +558,7 @@ static int h_auth(int argc, unsigned char **argv){ conf->authfuncs->desc = au->desc; conf->authfuncs->authenticate = au->authenticate; conf->authfuncs->authorize = au->authorize; + conf->authfuncs->blocks = au->blocks; break; } } diff --git a/src/mainconf.c b/src/mainconf.c index 7817d8c..14f8c77 100644 --- a/src/mainconf.c +++ b/src/mainconf.c @@ -313,8 +313,11 @@ static int srvprepare(struct srvstart *s, int argc, char **argv){ } if(conf->authfuncs){ + struct auth *au; + srv->authfuncs = copyauth(conf->authfuncs); if(!srv->authfuncs) return 2; + for(au = srv->authfuncs; au; au = au->next) if(au->blocks) srv->threadperclient = 1; } #else srv->needuser = 0; diff --git a/src/plugins/LdapPlugin/ldapauth.c b/src/plugins/LdapPlugin/ldapauth.c index 0296b21..3d3fc5a 100644 --- a/src/plugins/LdapPlugin/ldapauth.c +++ b/src/plugins/LdapPlugin/ldapauth.c @@ -551,6 +551,7 @@ PLUGINAPI int PLUGINCALL start(struct pluginlink * pluginlink, myalwaysauth.authenticate = ldapfunc; myalwaysauth.authorize = pluginlink->checkACL; myalwaysauth.desc = "ldap"; + myalwaysauth.blocks = 1; myalwaysauth.next = pluginlink->authfuncs->next; pluginlink->authfuncs->next = &myalwaysauth; diff --git a/src/plugins/PamAuth/pamauth.c b/src/plugins/PamAuth/pamauth.c index 8ad1069..5b4741a 100644 --- a/src/plugins/PamAuth/pamauth.c +++ b/src/plugins/PamAuth/pamauth.c @@ -141,6 +141,7 @@ PLUGINAPI int PLUGINCALL start(struct pluginlink * pluginlink, int argc, unsigne pamauth.authenticate = pamfunc; pamauth.authorize = pluginlink->checkACL; pamauth.desc = "pam"; + pamauth.blocks = 1; pamauth.next = pluginlink->authfuncs->next; pluginlink->authfuncs->next = &pamauth; diff --git a/src/plugins/WindowsAuthentication/WindowsAuthentication.c b/src/plugins/WindowsAuthentication/WindowsAuthentication.c index 2e42636..c398c59 100644 --- a/src/plugins/WindowsAuthentication/WindowsAuthentication.c +++ b/src/plugins/WindowsAuthentication/WindowsAuthentication.c @@ -80,6 +80,7 @@ PLUGINAPI int PLUGINCALL WindowsAuthentication(struct pluginlink * pluginlink, i alwaysauth.authenticate = windowsfunc; alwaysauth.authorize = pluginlink->checkACL; alwaysauth.desc = "windows"; + alwaysauth.blocks = 1; alwaysauth.next = pluginlink->authfuncs->next; pluginlink->authfuncs->next = &alwaysauth; loaded = 1; diff --git a/src/structures.h b/src/structures.h index 3289693..7b8123e 100644 --- a/src/structures.h +++ b/src/structures.h @@ -284,6 +284,7 @@ struct auth { AUTHFUNC authenticate; AUTHFUNC authorize; char * desc; + int blocks; /* waits other than in sockpoll(): PAM, LDAP */ }; struct iplist {