summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-04-10 19:20:00 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-05-24 10:26:57 (GMT)
commitc273d6a94e73f03b282a5b4d09ed94f330ff2df7 (patch)
tree557f96ca16210300aebedbe9b983028c026da70e
parent87092b460b64b45b0a69f9102b401d667740f3f0 (diff)
downloadNet_LDAP3-c273d6a94e73f03b282a5b4d09ed94f330ff2df7.tar.gz
Better error handling on ldapsearch usage (Bug #1733)
-rw-r--r--lib/Net/LDAP3.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Net/LDAP3.php b/lib/Net/LDAP3.php
index 6e9ca50..5967fa3 100644
--- a/lib/Net/LDAP3.php
+++ b/lib/Net/LDAP3.php
@@ -583,7 +583,7 @@ class Net_LDAP3
}
if (empty($moz_ldapsearch)) {
- $this->_debug("Mozilla LDAP C SDK binary ldapsearch not found, cannot get effective rights on subject $subject");
+ $this->_error("Mozilla LDAP C SDK binary ldapsearch not found, cannot get effective rights on subject $subject");
return null;
}
@@ -621,6 +621,11 @@ class Net_LDAP3
$this->_debug("LDAP: Command output:" . var_export($output, true));
$this->_debug("Return code: " . $return_code);
+ if ($return_code) {
+ $this->_error("Command $moz_ldapsearch returned error code: $return_code");
+ return null;
+ }
+
$lines = array();
foreach ($output as $line_num => $line) {
if (substr($line, 0, 1) == " ") {