--- /var/tmp/portage/sys-auth/pam_ldap-183/work/pam_ldap-183/pam_ldap.c 2006-10-19 15:22:27.000000000 +0200 +++ pam_ldap.c.new 2007-10-06 16:04:58.000000000 +0200 @@ -325,7 +325,8 @@ void nasty_ssl_hack (void) { - (void) dlopen ("/lib/security/pam_ldap.so", RTLD_LAZY); + /*Only to be able to use the old pam_ldap.so in case of need*/ + (void) dlopen ("/lib/security/pam_ldap2.so", RTLD_LAZY); } #endif /* HAVE_LDAPSSL_INIT */ @@ -2702,7 +2703,28 @@ #if LDAP_SET_REBIND_PROC_ARGS < 3 global_session = *psession; #endif + /*It is possible that the config= option has been modified since the last + call. In this case the config-file should be reread and new values + should be used. + + For example I have two config-files with different servers and different + distinguished names. + + Might only make sense in conjunction with the pam_auth-php-module, but + for this I need it. + + Until I really understand how pam_ldap works, this is a quick and dirty + patch to force pam_ldap to reread the configFile. + + Hopefully I don't break other things by doing so ... + + I have the bad feeling that I'm creating a memory leak, because I don't + free the old session, but I haven't worked out how to do this. + */ + if (((session->conf->configFile!=NULL)&&(strcmp(configFile,session->conf->configFile) == 0)) + || ((session->conf->configFile==NULL)&&(configFile==NULL))) return PAM_SUCCESS; + } *psession = NULL; @@ -3987,7 +4009,8 @@ /* static module data */ #ifdef PAM_STATIC struct pam_module _modstruct = { - "pam_ldap", +/*Only to be able to use the old pam_ldap in case of need*/ + "pam_ldap2", pam_sm_authenticate, pam_sm_setcred, pam_sm_acct_mgmt,