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.
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.