File: 1050_fix-ldap-fetch.patch

package info (click to toggle)
gosa 2.8~git20230203.10abe45%2Bdfsg-19
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 33,108 kB
  • sloc: php: 32,102; javascript: 10,836; pascal: 3,776; xml: 3,135; sh: 852; python: 162; makefile: 45; perl: 2
file content (17 lines) | stat: -rw-r--r-- 773 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Author: Guido Berhoerster <guido+debian@berhoerster.name>
Description: Fix LDAP fetch in case of empty results
 If the LDAP\Result is empty ldap_first_entry() returns false which is stored
 in $this->re[$srp]. Any subsequent calls to fetch will pass this as an argument
 to ldap_next_entry() which will throw an exception. Fix this by checking for a
 falsy value.
--- gosa.orig/include/class_ldap.inc
+++ gosa/include/class_ldap.inc
@@ -440,7 +440,7 @@ class LDAP
                     } else {
                         return array();
                     }
-                } else {
+                } else if ($this->re[$srp]) {
                     $this->re[$srp]= @ldap_next_entry(self::$cid, $this->re[$srp]);
                 }
                 if ($this->re[$srp])