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

Cannot have a username that begins with a number #141

Open
zeebok opened this issue Apr 8, 2022 · 3 comments
Open

Cannot have a username that begins with a number #141

zeebok opened this issue Apr 8, 2022 · 3 comments

Comments

@zeebok
Copy link
Contributor

zeebok commented Apr 8, 2022

What Happened?

When creating a user, it will autogenerate a username but allows you to change the username to whatever you would like. There is a validation for the username to be sure it is alphanumeric only but if a username starts with a digital it will fail validation.

For example User420 passes but 420User fails despite both falling under alphanumeric.

Steps to Reproduce

Go through initial setup until you are asked to create an account. Try to set the username field to start with a digit.

Expected Behavior

I should be able to create any username that is alphanumeric no matter the order of those characters.

OS Version

6.x (Odin)

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

No response

@vjr
Copy link
Member

vjr commented Apr 11, 2022

Just a note that I may have recently read on an ubuntu mailing list that there may be a similar restriction of not allowing usernames to begin with a number, so anyone reviewing or working on this issue might want to double check that?

@davidmhewitt
Copy link
Member

The systemd page on this topic is quite good: https://systemd.io/USER_NAMES/

In short, different distros have different rules for what constitutes a valid username.

The summary at the very bottom of that page gives a regex that aims to be compatible with all distros. That doesn't allow a digit as the first character.

So, for compatibility purposes, I'd be tempted to say that the current behaviour is already correct.

@zeebok
Copy link
Contributor Author

zeebok commented Apr 13, 2022

Alright, at the very least then I would think the error message when failing validation should make that clear.

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

No branches or pull requests

3 participants