-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the database user backend cache case insensitive like the DB table #27191
Conversation
Database users are already fetched from the database via the uid_lower column, but the cache is built using the cased version of the UID. That might lead to non-matches in case the casing is not the same. This change only touches the index of the in memory cache. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
strtolower should be enough, since Database complies with rules and does not allow non-ascii characters in the user id. I am afraid you may run into issues in setups where you have mixed-case type usernames. It is disconcerting that database backend would be fickle with user ids which should be exactly what they are, without variations (they are okay for login names). |
That's the reason I only changed the index of the cache. The database already provides the same set of users because there is a unique index on the uid_lower there could only be one variant in the database anyways. And as this only affects the database user backend it does not collide with other backends. Or do I miss something? |
If it has effects to the outside, then it may collide. And that's what it is all about, is it not? When i run Another (existing!) issue I see is the implementation of |
RIght ... but is this really what was intented here? because it doesn't make sense to search case insensitive, also return it from the DB and then only take it if it really matches the case. Because then you can also just search case sensitive and drop the uid_lower completely. Otherwise it would not make sense at all. 🙈 |
I think the lower_uid was mostly to have case-insensitive login names for the local users. and becaue of this it was blocking alterning user ids. |
Database users are already fetched from the database via the uid_lower column, but the cache is built using the cased version of the UID. That might lead to non-matches in case the casing is not the same. This change only touches the index of the in memory cache.
This was noticed in following case:
Problem:
I tested this with existing users and incoming/outgoing shares.