account username creation regex doesn't correlate with useradd regex #17704
PatrikMosko
started this conversation in
General
Replies: 2 comments 2 replies
-
btw, I do realize the regex that cockpit is using is POSIX-compliant for usernames, but question still remains the same, why its even there when useradd has its own internal vaidation check. |
Beta Was this translation helpful? Give feedback.
2 replies
-
I've opened a bug for this @ #17716. We're currently in the process of overhauling the user accounts page (current redesign @ #17604), so I'm hopeful that this will be addressed soon as well. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When trying to create new account, I am limited to usernames matching this regex:
^[a-zA-Z0-9.-_]*$
Based on what useradd(8) tells me I should be able to create usernames obeying roughly this pattern:
^[a-z_][a-z0-9_-]{0,30}([a-z0-9_-]|\$)$
In reality, after quick look in shadow/libmisc/chkname.c::is_valid_name (for ubuntu/focal), the proper regex should be:
^[^-~+:,\s][^:,\s]{,32}$
Is there any valid reason why cockpit is more strict when it comes to username selection?
What if cockpit admin will be allowed to insert his own regex (somewhere) to set his own rules for usernames?
Same potentially applies for passwords or common passwords checks (dictionary checks).
Beta Was this translation helpful? Give feedback.
All reactions