Projects
Kolab:3.4
php-pear-Net-LDAP3
no-password-logging_fix-fatal-error.patch
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File no-password-logging_fix-fatal-error.patch of Package php-pear-Net-LDAP3 (Revision 11)
Currently displaying revision
11
,
Show latest
diff --git a/lib/Net/LDAP3.php b/lib/Net/LDAP3.php index 1b3ac73..86c6310 100644 --- a/lib/Net/LDAP3.php +++ b/lib/Net/LDAP3.php @@ -481,7 +481,7 @@ class Net_LDAP3 return true; } - $this->_debug("C: Bind [dn: $bind_dn] [pass: $bind_pw]"); + $this->_debug("C: Bind [dn: $bind_dn]"); if (@ldap_bind($this->conn, $bind_dn, $bind_pw)) { $this->_debug("S: OK"); @@ -742,9 +742,14 @@ class Net_LDAP3 '"*"', ); - $command = implode(' ', $command); + // remove password from debug log + $command_debug = $command; + $command_debug[11] = '*'; - $this->_debug("LDAP: Executing command: $command"); + $command = implode(' ', $command); + $command_debug = implode(' ', $command_debug); + + $this->_debug("LDAP: Executing command: $command_debug"); exec($command, $output, $return_code); @@ -987,7 +992,9 @@ class Net_LDAP3 $result = $ldap->search($root_dn, '(objectclass=nsds5replicationagreement)', 'sub', array('nsds5replicahost')); if (!$result) { - $this->_debug("No replicas configured"); + $this->_debug("No replicas configured on $replica_host"); + $ldap->close(); + continue; } foreach ($result->entries(true) as $dn => $attrs) { @@ -1435,7 +1442,7 @@ class Net_LDAP3 $method = 'DIGEST-MD5'; } - $this->_debug("C: Bind [mech: $method, authc: $authc, authz: $authz] [pass: $pass]"); + $this->_debug("C: Bind [mech: $method, authc: $authc, authz: $authz]"); if (ldap_sasl_bind($this->conn, null, $pass, $method, null, $authc, $authz)) { $this->_debug("S: OK"); diff --git a/lib/Net/LDAP3/Result.php b/lib/Net/LDAP3/Result.php index 728b304..0759df0 100644 --- a/lib/Net/LDAP3/Result.php +++ b/lib/Net/LDAP3/Result.php @@ -71,7 +71,7 @@ class Net_LDAP3_Result implements Iterator } /** - * + * Wrapper for ldap_sort() */ public function sort($attr) { @@ -79,18 +79,23 @@ class Net_LDAP3_Result implements Iterator } /** - * + * Get entries count */ public function count() { - if (!isset($this->count)) + if (!isset($this->count)) { $this->count = ldap_count_entries($this->conn, $this->result); + } return $this->count; } /** + * Wrapper for ldap_get_entries() * + * @param bool $normalize Optionally normalize the entries to a list of hash arrays + * + * @return array List of LDAP entries */ public function entries($normalize = false) { @@ -103,6 +108,14 @@ class Net_LDAP3_Result implements Iterator return $entries; } + /** + * Wrapper for ldap_get_dn() using the current entry pointer + */ + public function get_dn() + { + return $this->current ? ldap_get_dn($this->conn, $this->current) : null; + } + /*** Implement PHP 5 Iterator interface to make foreach work ***/
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.