6.0.0-beta1
7/5/25

[#10892] Password not change in memory
Summary Password not change in memory
Queue Passwd
Queue Version 4.0
Type Bug
State Duplicate
Priority 3. High
Owners
Requester azurit (at) pobox (dot) sk
Created 12/30/2011 (4936 days ago)
Due
Updated 01/10/2012 (4925 days ago)
Assigned
Resolved 01/03/2012 (4932 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
01/10/2012 06:09:12 PM azurit (at) pobox (dot) sk Comment #7 Reply to this comment
Michael, we are using poppassd as backend and IMP is doing 
authentication via remote IMAP server - so changing password in IMP 
means changing password in IMAP server (in our invironment). Setting 
new password on IMAP server is required and i don't see why is this 
not expected.

passwd module with poppassd backend was working very fine in Horde 3.

What is the ticket you are talking about?
01/10/2012 05:50:04 PM Michael Slusarz Comment #6 Reply to this comment
I created new one cos other two are *closed* and were *not* reopened 
after my comments.
Then comments should be made in those tickets.

FWIW, the solution given in this ticket is completely wrong.  First, 
an application should NEVER NEVER access member variables of another 
application.  That is just wrong.

And why are you trying to reset the IMAP password in IMP anyway?  Just 
because your password is changed via the passwd module, what does this 
have to do with an IMAP password on the remote server.  It is 
*possible* that the two may be related, but certainly not required or 
expected.

The proper solution, as implemented by Jan in the other ticket, is to 
clear all credentials in the session and require the user to 
re-authenticate.  If that is not working for you, then that is the bug 
that needs to be fixed.  But the logic of that solution is correct.
01/05/2012 12:10:45 PM azurit (at) pobox (dot) sk Comment #5 Reply to this comment
I created new one cos other two are *closed* and were *not* reopened 
after my comments.
01/05/2012 10:23:51 AM Jan Schneider Comment #4 Reply to this comment
I'm not ignoring this, but creating a new ticket if there already 
*are* tickets for this issue doesn't help anyone. If you have anything 
to add to this issue, then comment on the existing tickets.
01/03/2012 12:25:13 PM azurit (at) pobox (dot) sk Comment #3 Reply to this comment
Jan, I created new bug cos other two are marked has 'resolved' and 
'duplicate (of that resolved)'. I don't understand why you are 
ignoring this issue, I even found where exactly it is happening and 
created a simple patch (ok, i believe it's not perfect but it's 
working for me). I reported LOTS of other REAL bugs so i don't know 
why you don't believe me this is really a issue.
01/03/2012 09:12:44 AM Jan Schneider Comment #2
State ⇒ Duplicate
Reply to this comment
There are several duplicates.
12/30/2011 09:43:02 AM azurit (at) pobox (dot) sk Comment #1
Priority ⇒ 3. High
Type ⇒ Bug
Summary ⇒ Password not change in memory
Queue ⇒ Passwd
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
Hi,

we are havign problems with password changing - is it correctly 
changes on IMAP server but not in memory in Horde, so session is 
broken and user must relogin (with new password). This is, maybe, 
happening cos we are using memcached for sessions inside PHP.

I started to digging deeper into this and i found out something
interesting. When password is changed it is reseted in cache via
resetCredentials function. This function is reseting password stored
in memory (in session). Problem is that password from session is NEVER
used for logging into IMAP server.

Login to IMAP is done via Horde_Imap_Client which takes login and
password as argument (in $params) and these values are set ONLY in
constructor (this is done by Horde/IMP in createImapObject function
called in Auth.php). Problem is that IMAP object is initialized only
ONCE per IMAP login in our installation - so, when password changes,
it is correctly updated in session but gets NEVER updated in IMAP
object. I was doing some debug logging inside Horde and Horde/IMP and
it is really like this, constructor for Horde_Imap_Client is called
only once per login, the IMAP object is probably serialized and cached
somewhere.

Sending patch which works for me:

File: passwd/lib/Passwd.php
Function (at the end of file): resetCredentials
Code (i added 3 lines which starts by '$imp_imap'):

       static public function resetCredentials($old_password, $new_password)
       {
           if ($GLOBALS['registry']->getAuthCredential('password') ==
$old_password) {
               $GLOBALS['registry']->setAuthCredential('password',
$new_password);

               $imp_imap =
$GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create();
               $imp_imap->ob = NULL;

$imp_imap->createImapObject($GLOBALS['registry']->getAuth(),
$new_password, IMP_Auth::getAutoLoginServer());
           }
       }

Saved Queries