[Bug 592] New - Error handling in poppassd.php3

bugs@bugs.horde.org bugs@bugs.horde.org
Tue, 23 Jan 2001 15:41:09 -0400


http://bugs.horde.org/show_bug.cgi?id=592

*** shadow/592	Tue Jan 23 15:41:08 2001
--- shadow/592.tmp.11657	Tue Jan 23 15:41:08 2001
***************
*** 0 ****
--- 1,48 ----
+ Bug#: 592
+ Product: Horde
+ Version: 2.2 Stable
+ Platform: PHP Code
+ OS/Version: Linux
+ Status: NEW   
+ Resolution: 
+ Severity: normal
+ Priority: P2
+ Component: IMP
+ Area: BUILD
+ AssignedTo: chuck@horde.org                            
+ ReportedBy: r_maureira@inacap.cl               
+ URL: 
+ Summary: Error handling in poppassd.php3
+ 
+ It's seems like poppassd doesn't handle in a proper way the response from the 
+ poppassd server when it successfully changes the password.
+ 
+ The response sent by the poppassd is like this:
+ 200 your new password please.
+ newpass xxxxxxx
+ Changing password for user yyyyy
+ 200 Password changed, thank-you
+ 
+ In line 128 of poppassd.php3 it reads 
+ $input = fgets($passd,128);
+ 
+ Then it compares the first 3 chars of data received with 200, because poppassd 
+ first sends a line for "Changing..." poppassd.php3 never returns a valid 
+ response when the password has been changed successfully. To get rid of this 
+ bug, just add another 
+ 
+ $input = fgets($passd,128); 
+ 
+ so the file now reads:
+ 
+ line                 code
+ 128                  $input = fgets($passd,128); 
+ 129                  $input = fgets($passd,128); 
+ 130                  if (!(substr($input, 0, 3) == 200)) {
+ 
+ Now it reads the second line, thus comparing correctly and giving the correct 
+ response when the password is changed.
+ 
+ 
+ Regards.
+ Robinson Maureira C.