Needs work
Project:
Bakery Single Sign-On System
Version:
3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Feb 2010 at 18:52 UTC
Updated:
16 May 2025 at 17:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
gregglesDo you know where in the code this problem arises?
There are some explicit calls to "lower" in some of the queries. I think that makes sense on the e-mails but not on the usernames.
Comment #2
avpadernoThe problem could be that.
As normally the usernames are not case sensitive, it would be probably better to have an option that allow to decide if the usernames must be compared in a case sensitive way, or not.
Comment #3
avpadernoThe patch I attached here should resolve the issue with usernames that differ by the characters case.
I didn't add the code for the settings I was talking of, as I didn't know if it was something desirable. IMO, the module should have that settings, if it is thought to work also on other Drupal sites.
Comment #4
juliangb commentedWould it be possible just to clarify the difference between d.o. and other Drupal sites?
If there is a difference, I'd have thought that Bakery should handle the standard Drupal case, with any customisation in the drupalorg module?
Comment #5
avpadernoThe difference is that normally on a Drupal site is not possible to create two users like kiamlaluno, and KiamLaLuno; this is possible in Drupal.org because the collation used for the users table has been changed in order to allow the use of accented letters in the username. The effect of changing the collation is that now usernames are case sensitive.
Comment #6
avpadernoI can confirm the patch also resolves the issue in the self-repairing code.
Comment #7
juliangb commentedThanks for the explanation.
I'm very keen for Bakery to be a generic module as well as for d.o. (i.e. for my sites), so keen to make sure that any changes do not impact negatively on generic installations.
Based on what you've said, i'd be very keen for the settings as you said in #3 - defaulting to the current behaviour (i.e. the drupal norm).
Comment #8
juliangb commentedHere is a patch that will apply to D6 installs.
It takes the removal of the LOWER() functions as in kiamlaluno's patch in #3, but only applies the change based on an admin setting, which defaults to the current (non-patched) behaviour.
Comment #9
gregglesWhile this code is safe on its own, it feels weird to me and is not typical Drupal style.
I think it would be better
if (variable_get('bakery_username_case', FALSE)) {
if (db_result(db_query("SELECT COUNT(*) FROM {users} WHERE uid != %d AND LOWER(name) = LOWER('%s')", $user->uid, $cookie['name'])) > 0) {
...etc....
Comment #10
juliangb commentedNo problem. Revised patch attached.
Comment #11
juliangb commentedAttached is the patch for D7 (HEAD). #10 is for D6.
This also removes a line of code that has appeared somewhere in the port.
Comment #12
gribnif commentedIs this patch live on groups.drupal.org yet? I ask, because I and others are having problems logging-into that site, which sound like they could be caused by this issue. See http://drupal.org/node/897122.
Comment #13
avpadernoThe patch is still not applied on g.d.o because it is still under review.
Comment #14
jredding commentedI'm just pinging for an update on this. I've noticed this behavior happening on a.d.o and the Chicago site.
Comment #15
drummsubscribe
Comment #16
coltraneThe patch looks sound but I'm having a hard time testing this.
Comment #17
gregglesIn case it was your stopping point, the users.name for drupal.org has the collation utf8_bin.
I got that form
show full columns from users;Comment #18
coltraneThanks, it's more an issue with recreating the problem so I test if the patch fixes it.
@greggles, can I test this on groups' scratch?
Comment #19
drummFor Drupal.org, the real issue is even having usernames which only differ by case used, #1034852: Clean up accounts with case-insensitive duplicate names.
Comment #20
purencool commentedTest to see if this is happening in the latest version.
Comment #21
avpadernoDrupal.org is no longer using this module for SSO. Is this an issue other Drupal sites could have?
Comment #22
avpaderno