initial-setup icon indicating copy to clipboard operation
initial-setup copied to clipboard

Cannot have a username that begins with a number

Open zeebok opened this issue 3 years ago • 3 comments

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

zeebok avatar Apr 08 '22 03:04 zeebok

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?

vjr avatar Apr 11 '22 02:04 vjr

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.

davidmhewitt avatar Apr 11 '22 11:04 davidmhewitt

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

zeebok avatar Apr 13 '22 06:04 zeebok