6.0.0-git
2019-04-21

[#12519] Inconsistent use of $user & $username in passwd/lib/Driver/Ldap.php
Summary Inconsistent use of $user & $username in passwd/lib/Driver/Ldap.php
Queue Passwd
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester adorman (at) ironicdesign (dot) com
Created 2013-07-31 (2090 days ago)
Due
Updated 2013-08-01 (2089 days ago)
Assigned
Resolved 2013-08-01 (2089 days ago)
Milestone
Patch No

History
2013-08-01 18:21:12 Michael Slusarz Comment #6 Reply to this comment
Jan's commit 
https://github.com/horde/horde/commit/a6cc00a83599434e441b824050248a2b7334b2cd

put the variables to $username now it's back to $user?
Because #12331 was an incorrect fix.  Passwd_Driver_Ldap inherits from 
Passwd_Driver.  In Passwd_Driver, $user is used.  Using anything else 
will throw PHP strict warnings since the method signatures do not match.
2013-08-01 11:16:41 simon (at) simonandkate (dot) net Comment #5 Reply to this comment
Jan's commit 
https://github.com/horde/horde/commit/a6cc00a83599434e441b824050248a2b7334b2cd

put the variables to $username now it's back to $user?
2013-08-01 02:28:17 adorman (at) ironicdesign (dot) com Comment #4 Reply to this comment

[Show Quoted Text - 14 lines]
Thanks Michael.
2013-08-01 00:28:29 Michael Slusarz Comment #3
Assigned to Michael Slusarz <slusarz@horde.org>
State ⇒ Resolved
Priority ⇒ 1. Low
Reply to this comment
Passwd 5.0.1.
2013-08-01 00:27:27 Git Commit Comment #2 Reply to this comment
Changes have been made in Git (master):

commit 0114ff62b9103f2c4b39c9867d6651f5d8c080e7
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Wed Jul 31 18:25:13 2013 -0600

     Bug #12519: match abstract method prototype

  passwd/lib/Driver/Kolab.php     |    6 +++---
  passwd/lib/Driver/Ldap.php      |   10 +++++-----
  passwd/lib/Driver/Smbpasswd.php |    2 +-
  3 files changed, 9 insertions(+), 9 deletions(-)

http://git.horde.org/horde-git/-/commit/0114ff62b9103f2c4b39c9867d6651f5d8c080e7
2013-07-31 20:39:06 adorman (at) ironicdesign (dot) com Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Summary ⇒ Inconsistent use of $user & $username in passwd/lib/Driver/Ldap.php
Queue ⇒ Passwd
Milestone ⇒
Patch ⇒ No
Reply to this comment
The protected function _changePassword($user, $oldpass, $newpass) 
accepts $user as input, but it uses $username in a couple of places 
where it should be using $user.  This causes an incorrect user on line 
101 and empty userdn on line 110.

Sorry I do not have a full patch...But here is a diff showing the fixed lines.

diff ../Ldap.php.old ../Ldap.php.new
101c101
<             $username .= '@' . $this->_params['realm'];
---
             $user .= '@' . $this->_params['realm'];
109,110c109,110
<             // $this->_userdn = $this->_ldap->findUserDN($username);
<             $this->_userdn = $this->_params['uid'] . '=' . $username 
. ',' . $this->_params['basedn'];
---
             // $this->_userdn = $this->_ldap->findUserDN($user);
             $this->_userdn = $this->_params['uid'] . '=' . $user . 
',' . $this->_params['basedn'];

Saved Queries