Closed (fixed)
Project:
Bakery Single Sign-On System
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
20 Jan 2011 at 02:10 UTC
Updated:
21 Sep 2011 at 22:11 UTC
Jump to comment: Most recent file
Comments
Comment #1
drummPatch attached.
Comment #2
drummI believe this is helping cause uid 0 deletions. To reproduce, on a slave site, request a new password by email, where the slave site already has the account. Since bakery does not find an existing account, it goes through most of bakery_request_account(). At the end, it has a duplicate name and the last user_save() fails. The final cleanup does user_delete() on the empty account, deleting uid 0. The code should be more forgiving, but this patch is a start.
Comment #3
drummhttp://drupal.org/user/689172 and http://drupal.org/user/21209 existing doesn't help, but that's another issue.
Comment #4
drummAdded:
- Store the $stub_uid; $account->uid is lost during an unsuccessful user_save().
- Clean up the stray stub accounts that have not been used.
Comment #5
gregglesGreat detective work, drumm. Were you able to deploy this anywhere to help test?
Comment #6
drummI tested a bit locally. The underlying condition on d.o, #1034852: Clean up accounts with case-insensitive duplicate names, is now fixed. The best test might involve hacking user_save() or the master server to sometimes fail.
Comment #7
gregglesThis line confused me at first:
I had forgotten why the $name might be used as an e-mail, but it's because this is sometimes coming from the password request form which allows either name or mail, so I added a little more to the doxygen to explain that it might be an e-mail even if the variable is called "$name".
Now committed to 6.x-2.x-dev http://drupal.org/cvs?commit=490722
Comment #8
coltraneThis made it in.