URL:
https://github.com/freeipa/freeipa/pull/2067
Author: netoarmando
Title: #2067: Prevent the creation on users and groups with numeric characters only
Action: opened
PR body:
"""
Update regular expression validator to prevent user and group creation.
Issue:
https://pagure.io/freeipa/issue/7572
The expression updated by this PR was changed only twice [since the beginging on
project](https://github.com/freeipa/freeipa/blob/d1691eee88c5462ef1d01561...:
- [first
change](https://github.com/freeipa/freeipa/commit/37200806118d39ef8afe84a...
removed the lenght limit
- [second
change](https://github.com/freeipa/freeipa/commit/8f8e3d008f1de91337a83ea...
unified the expression used by user and group in the `constants.py` file
This PR doesn't prevent the creation of user or groups starting with a number. Related
info:
https://access.redhat.com/solutions/3103631
Also, I haven't updated the error message, should I do it? If so, possible wording:
```
may only include letters, numbers, _, -, ., $ and must contain a letter
```
It seems that _systemd_ has a [stricter set of
rules](https://github.com/systemd/systemd/blob/master/src/basic/user-util...,
which I think it could affect FreeIPA in the future:
- We don't allow any dots (this would break chown syntax which
permits dots as user/group name separator)
- We require that names fit into the appropriate utmp field
- We don't allow empty user names
"""
To pull the PR as Git branch:
git remote add ghfreeipa
https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/2067/head:pr2067
git checkout pr2067