Skip to content

Trim the login name - #18135

Merged
rullzer merged 1 commit into
masterfrom
fix/trim-login-name
Nov 29, 2019
Merged

Trim the login name#18135
rullzer merged 1 commit into
masterfrom
fix/trim-login-name

Conversation

@ChristophWurst

Copy link
Copy Markdown
Member

Otherwise we keep on using it with leading or trailing whitespaces for
app tokens and other logic. The reason this doesn't throw an error
immediately with local users is that (My)SQL compares strings regardless
of their padding by default. So we look up 'uid ' and get the row for
the user 'uid'.
Other back-ends will lead to a hard error, though, and the user is
unable to log out as all request fail.

Ref https://stackoverflow.com/a/10495807/2239067

@georgehrkegeorgehrke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 🐘

@ChristophWurstChristophWurst added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Nov 27, 2019
@ChristophWurst

Copy link
Copy Markdown
MemberAuthor

/backport to stable17

@ChristophWurst

Copy link
Copy Markdown
MemberAuthor

/backport to stable16

Otherwise we keep on using it with leading or trailing whitespaces for
app tokens and other logic. The reason this doesn't throw an error
immediately with local users is that (My)SQL compares strings regardless
of their padding by default. So we look up 'uid ' and get the row for
the user 'uid'.
Other back-ends will lead to a hard error, though, and the user is
unable to log out as all request fail.
Ref https://stackoverflow.com/a/10495807/2239067
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@georgehrke

Copy link
Copy Markdown
Member

@rullzer merge?

@rullzer
rullzer merged commit 44fc962 into masterNov 29, 2019
@rullzer
rullzer deleted the fix/trim-login-name branch November 29, 2019 07:47
@backportbot-nextcloud

Copy link
Copy Markdown

backport to stable17 in #18156

@backportbot-nextcloud

Copy link
Copy Markdown

The backport to stable16 failed. Please do this backport manually.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishbugfeature: authenticationfeature: users and groups

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@ChristophWurst@georgehrke@juliusknorr@gary-kim@rullzer