[Mrbs-general] Two bugs in auth_ldap.inc
Brought to you by:
jberanek
From: Andrej M. <and...@mc...> - 2001-07-06 19:03:26
|
Greetings all, I ran into two bugs in auth_ldap.inc while getting authentication working against an MS Exchange server. First, I didn't need a base DN. The original code assumes not only that the $ldap_base_dn array is set, but that its contents are non-empty strings. Now it just goes up to the array size. Second, the second invocation of authGet() used the unset $realm variable, rather than $auth["realm"] . Here's the patch: --- auth_ldap.inc Fri Jul 6 14:48:41 2001 +++ auth_ldap.inc.orig Sun Mar 4 17:30:04 2001 @@ -46,7 +46,7 @@ $ldap=@ldap_connect($ldap_host); if($ldap) { - for($i = 0; $i < sizeof($ldap_base_dn); $i++) + for($i = 0; $ldap_base_dn[$i]; $i++) { $dn = "cn=" . $user . "," . $ldap_base_dn[$i]; @@ -61,7 +61,7 @@ } // If we failed prompt for username/password - authGet($auth["realm"]); + authGet($realm); // return failure return 0; -- Andrej Marjan Webmonkey Community Services Cluster |