MDL-63887 auth_ldap: avoid infinite loop when search limit is reached

This commit is contained in:
papillon326
2018-12-06 15:39:35 +08:00
committed by Mark Nelson
parent 8707682e3a
commit 43dcb956ba
+6 -1
View File
@@ -721,7 +721,12 @@ class auth_plugin_ldap extends auth_plugin_base {
continue;
}
if ($ldappagedresults) {
ldap_control_paged_result_response($ldapconnection, $ldapresult, $ldapcookie);
$pagedresp = ldap_control_paged_result_response($ldapconnection, $ldapresult, $ldapcookie);
// Function ldap_control_paged_result_response() does not overwrite $ldapcookie if it fails, by
// setting this to null we avoid an infinite loop.
if ($pagedresp === false) {
$ldapcookie = null;
}
}
if ($entry = @ldap_first_entry($ldapconnection, $ldapresult)) {
do {