Only in ./modules/experimental: .deps Only in ./modules/experimental: .libs Only in ./modules/experimental: Makefile diff -r -u ../httpd-2.0.45/modules/experimental/mod_auth_ldap.c ./modules/experimental/mod_auth_ldap.c --- ../httpd-2.0.45/modules/experimental/mod_auth_ldap.c Wed Mar 26 14:31:38 2003 +++ ./modules/experimental/mod_auth_ldap.c Sat Apr 5 21:23:27 2003 @@ -105,6 +105,7 @@ deref_options deref; /* how to handle alias dereferening */ char *binddn; /* DN to bind to server (can be NULL) */ char *bindpw; /* Password to bind to server (can be NULL) */ + char *password_attr; /* Attribute to compare against the password (can be NULL) */ int frontpage_hack; /* Hack for frontpage support */ int user_is_dn; /* If true, connection->user is DN instead of userid */ @@ -362,7 +363,8 @@ /* do the user search */ result = util_ldap_cache_checkuserid(r, ldc, sec->url, sec->basedn, sec->scope, - sec->attributes, filtbuf, sent_pw, &dn, &vals); + sec->attributes, filtbuf, sent_pw, + sec->password_attr, &dn, &vals); util_ldap_connection_close(ldc); /* sanity check - if server is down, retry it up to 5 times */ @@ -885,6 +887,7 @@ } + command_rec mod_auth_ldap_cmds[] = { AP_INIT_TAKE1("AuthLDAPURL", mod_auth_ldap_parse_url, NULL, OR_AUTHCFG, "URL to define LDAP connection. This should be an RFC 2255 complaint\n" @@ -958,6 +961,11 @@ AP_INIT_FLAG("AuthLDAPFrontPageHack", ap_set_flag_slot, (void *)APR_OFFSETOF(mod_auth_ldap_config_t, frontpage_hack), OR_AUTHCFG, "Set to 'on' to support Microsoft FrontPage"), + + AP_INIT_TAKE1("AuthLDAPPasswordAttr",ap_set_string_slot, + (void *)APR_OFFSETOF(mod_auth_ldap_config_t, password_attr), OR_AUTHCFG, + "If set the given attribute will be matched against the password rather than trying to bind" + "as the user."), AP_INIT_TAKE1("AuthLDAPCharsetConfig", set_charset_config, NULL, RSRC_CONF, "Character set conversion configuration file. If omitted, character set" Only in ./modules/experimental: mod_auth_ldap.c.orig Only in ./modules/experimental: mod_auth_ldap.la Only in ./modules/experimental: mod_auth_ldap.lo Only in ./modules/experimental: mod_auth_ldap.o Only in ./modules/experimental: mod_ldap.la Only in ./modules/experimental: modules.mk diff -r -u ../httpd-2.0.45/modules/experimental/util_ldap.c ./modules/experimental/util_ldap.c --- ../httpd-2.0.45/modules/experimental/util_ldap.c Fri Mar 7 15:12:29 2003 +++ ./modules/experimental/util_ldap.c Sat Apr 5 21:34:44 2003 @@ -735,8 +735,8 @@ LDAP_DECLARE(int) util_ldap_cache_checkuserid(request_rec *r, util_ldap_connection_t *ldc, const char *url, const char *basedn, int scope, char **attrs, - const char *filter, const char *bindpw, const char **binddn, - const char ***retvals) + const char *filter, const char *bindpw, const char *pwattr, + const char **binddn, const char ***retvals) { const char **vals = NULL; int result = 0; @@ -865,6 +865,8 @@ return LDAP_INVALID_CREDENTIALS; } + if(bindpw == NULL || pwattr == NULL) { + /* * Attempt to bind with the retrieved dn and the password. If the bind * fails, it means that the password is wrong (the dn obviously @@ -884,6 +886,18 @@ ldap_msgfree(res); return result; } + + } else { + if((result = ldap_compare_s(ldc->ldap,*binddn,pwattr,bindpw)) == LDAP_SERVER_DOWN) { + ldc->reason = "ldap_simple_compare_s() to check user credentials failed with server down"; + goto start_over; + } + + if(result != LDAP_COMPARE_TRUE) { + ldc->reason = "ldap_compare_s() password compare failed"; + return result; + } + } /* * Get values for the provided attributes. Only in ./modules/experimental: util_ldap.c.orig Only in ./modules/experimental: util_ldap.c.rej Only in ./modules/experimental: util_ldap.c~ Only in ./modules/experimental: util_ldap.lo Only in ./modules/experimental: util_ldap.o Only in ./modules/experimental: util_ldap_cache.lo Only in ./modules/experimental: util_ldap_cache.o Only in ./modules/experimental: util_ldap_cache_mgr.lo Only in ./modules/experimental: util_ldap_cache_mgr.o Only in ./include: ap_config_auto.h Only in ./include: ap_config_layout.h diff -r -u ../httpd-2.0.45/include/util_ldap.h ./include/util_ldap.h --- ../httpd-2.0.45/include/util_ldap.h Fri Mar 7 15:12:30 2003 +++ ./include/util_ldap.h Sat Apr 5 21:25:26 2003 @@ -270,7 +270,8 @@ */ LDAP_DECLARE(int) util_ldap_cache_checkuserid(request_rec *r, util_ldap_connection_t *ldc, const char *url, const char *basedn, int scope, char **attrs, - const char *filter, const char *bindpw, const char **binddn, const char ***retvals); + const char *filter, const char *bindpw, const char *pwattr, + const char **binddn, const char ***retvals); /** * Checks if SSL support is available in mod_ldap Only in ./include: util_ldap.h.orig Only in ./include: util_ldap.h.rej Only in ./include: util_ldap.h~