Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
user system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Nov 2008 at 23:31 UTC
Updated:
18 Mar 2011 at 19:09 UTC
Jump to comment: Most recent file
Comments
Comment #1
hunmonk commentedlogintoboggan has nothing to do with the request new password feature.
Comment #2
hajo commentedConfirmed. We have tight access rules on e-mail adresses on our site and when onetry ies to get a new password by entering the username this is refused because the username is checked against the e-mail rules.
This bug has been introduced in version 1.745.2.35 (tagged since DRUPAL-5-11) of /drupal/modules/user/user.module.
In user_pass_validate():
There is a logical error in the if condition.
Please feel free to submit a patch. You can get the revision history of user.module at http://cvs.drupal.org/viewvc.py/drupal/drupal/modules/user/user.module?v...
Regards,
hajo
Comment #3
hajo commentedNew code is
This way drupal_is_denied is only called with parameters matching the way the account was loaded.
Comment #4
hajo commentedThe bug is present in Drupal 5 and 6 in the latest version. In Drupal 5 it is in file user.module, in Drupal 6 it is in user.pages.inc. The bug is not present in Drupal 7.
Comment #5
damien tournoud commentedD7 is still missing parts of SA-2008-060. Bumping to 7 so that we can fix that too.
The correct logic should be:
Comment #6
vesapalmu commentedWe have a problem with this in few different live 6.x sites. IF SA-2008-060 is not an issue in 6.x any longer is there any chance this patch would get included in 6.12?
Comment #7
gpk commentedIf D7 is still missing parts of SA-2008-060 then this is critical for 7.x...
Comment #8
sun.core commentedAny updates?
Comment #9
alberto56 commentedWhere can one define access rules in D7? (admin/user/rules/list doesn't work for me)
Comment #10
catchIt doesn't exist in D7. This probably needs to move to the not-yet-functioning-needs-another-co-maintainer replacement http://drupal.org/project/user_restrictions
Comment #11
hajo commentedBecause the access rules functionality was taken out of D7, I submit a patch against D6, namely version 1.11.2.2 of modules/user/user.pages.inc.
Wrong file: Please see file from comment #12.
Comment #12
hajo commentedWrong patch-file in comment #11
Comment #13
seanburlington commentedThe patch in #12 is a good minimal patch to fix the bug
It just moves the test to after the account user_load is performed and then ensures that the username is validated against the username rules and the email is validated against the email rules
I've tested the patch and it works for me.
thanks hajo
Comment #14
gpk commentedPatch at #11 is basically the same as at duplicate issue #386138-6: Can't request new password using email address.
However the one at #11 is not in the correct format - diff needs to be run from the Drupal root, not the user module's folder. Also one of the blank lines next to the removed block of code should also be removed.
Comment #15
seanburlington commentedpatch from drupal root attached
Comment #16
chawl commentedThis should be committed to next release, very annoying indeed.
Patch works flawlessly on 6.16 BTW. Tx.
Comment #17
frankcarey commentedworked well, code seems logical
Comment #18
jaydubb181 commentedThis patch fixed this issue on my site as well. Thank you seanburlington.
Comment #19
seanburlington commentedcredit where it's due - the patch belongs to hajo - I just reviewed it and tweaked the format
It'd be good to get it into the next release :-)
Comment #20
hajo commentedActually, the code is written by Damien Tournoud since my first proposal wasn't correct. As you wrote: credit where it's due ;-)
Comment #21
jaydubb181 commentedThank you Damien!
Comment #22
gábor hojtsyGreat, committed, thanks.
Comment #24
adrianpintilie commentedthe patch is not correct.
users who are BLOCKED are excluded from the search due to restriction in the rule:
$account = user_load(array('name' => $name, 'status' => 1));
status-> 1
the correct search should be:
$account = user_load(array('name' => $name));
Comment #25
hajo commentedThat's the way it is meant to be, isn't it? See the comment "// Blocked accounts cannot request a new password" in Damiens code (Comment No. 5).
Comment #26
hajo commentedComment #27
joseph.chambers commentedPost 5 solved the issue for me and seems to be secure. Will this be put into the source for version 6?
Comment #28
hajo commentedIt is, at least in version 6.20.