Skip to content
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

Restrict username to lowercase and not only number when signing up #78

Merged
merged 2 commits into from
Mar 25, 2021

Conversation

cmd-ntrf
Copy link
Contributor

@cmd-ntrf cmd-ntrf commented Mar 24, 2021

Mokey currently allows case-sensitive username when signing-up. However, the user_add rpc call sanitizes the username and make it all lowercase. The user signing-up is never warned, so it might try to login with the case sensitive version of its username.

Furthermore, the homedir value is created in Mokey and is not sanitized by the rpc_call. So when the user logins with its lowercase username, the value of $HOME is wrong, and the user's session starts in /.

This PR proposes to make sure the username is lowercase. I have also added check that the username is not only made of numbers, which is not allowed in FreeIPA.

@aebruno
Copy link
Member

aebruno commented Mar 25, 2021

Looks good. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants