Skip to content

account: Fix username validation

Xiang Fan requested to merge sfanxiang/gnome-initial-setup:username into master

man useradd says:

Usernames must start with a lower case letter or an underscore, followed by lower case letters, digits, underscores, or dashes. They can end with a dollar sign. In regular expression terms: [a-z_][a-z0-9_-]*[$]?

The current implementation uses different validation rules, so you can enter a username that will never be created. This patch makes it follow useradd except for starting _ or trailing $.

po files may need to be updated, but I've no idea how.

Edited by Xiang Fan

Merge request reports