Uh oh!
There was an error while loading. Please reload this page.
Don't attempt to translate login names to uids when uids are provided - #7611
Conversation
rullzer
commented
Jan 2, 2018
@blizzz how to test this? Like how to test the case where it causes issues? |
blizzz
commented
Jan 3, 2018
Was tested successfully #6986 (comment) |
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
where appropriate, the preLoginNameUsedAsUserName hook should be thrown. Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Codecov Report
@@ Coverage Diff @@## master #7611 +/- ##
=============================================
- Coverage 51.2% 30.74% -20.46% + Complexity 24893 24890 -3
=============================================
Files 1602 1602 Lines 94803 94801 -2 Branches 1372 1372 =============================================
- Hits 48543 29146 -19397 - Misses 46260 65655 +19395
|
blizzz
commented
Jan 3, 2018
What I did here (more a theoretical scenario) was to have two LDAP users a different cased givenName ("martha" and "MARTHA") and used this as internal username attribute, as well as login attribute. Without the change only the lowercase user would show up on the users page, with it both are shown. Also, on |
MorrisJobke
commented
Jan 3, 2018
@blizzz There are 30 failures in unit tests. |
Boy, already the very first one I look into tests the undesirable behaviour. Was downstreamed #1915. 🙈 |
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Oh, and then we have the fact that the local user backend sort of accepts user ids in any case. I am impressed this did not blow up yet, since the lower casing against the database happens only against the users table, not others, like preferences iirc. I am kllling
|
blizzz
commented
Jan 3, 2018
Would extend |
blizzz
commented
Jan 3, 2018
The background of #7611 (comment) is that this is another downstream "fix" that was introduced, because a prior downstream "fix" inserted some horrible behaviour this PR is ironing out. Tests passing now, would like to have @MorrisJobke 's OK, too, however. |
MorrisJobke
commented
Jan 3, 2018
CI failure is due to a hiccup and can be ignored. |
It's a legacy of #1142 which was a downstream of a poor fix, that resolved password reset of local users, when the login name provided did not match the user name. The fix in place was to pipe every request to the user manager through the
loginName2UserNameeven if a user id was provided. With other user backends (cough LDAP cough) it might not cost a bit of performance, but also may return false positives. Unfortunately this happens, so a backport is necessary.While resolving login names to user names is not terribly rock solid, back then we introduced this mechanism for federated shares, since end users do not know their user id. This mechanism can be triggered by throwing a hook on demand. Which is what is happening now.
fixes#7445#6986