stages/users: support a dot inside a username

From IEEE Std 1003.1-2017:

 3.437 User Name:
A string that is used to identify a user; see also User Database. To be
portable across systems conforming to POSIX.1-2017, the value is composed
of characters from the portable filename character set. The <hyphen-minus>
character should not be used as the first character of a portable user name.

 3.282 Portable Filename Character Set
The set of characters from which portable filenames are constructed.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 8 9 . _ -

The last three characters are the <period>, <underscore>, and <hyphen-minus>
characters, respectively.

---

The regex checking the username in org.osbuild.users stage omitted the
<period> character before. This commit adds it and modifies the stage
test in order to cover this change.

Fixes: rhbz#2104464
This commit is contained in:
Ondřej Budai 2022-07-20 10:20:39 +02:00 committed by Ondřej Budai
parent 7dcc7d4499
commit 092f886904
4 changed files with 17 additions and 6 deletions

View file

@ -26,7 +26,7 @@ SCHEMA = """
"type": "object",
"description": "Keys are usernames, values are objects giving user info.",
"patternProperties": {
"^[A-Za-z0-9_][A-Za-z0-9_-]{0,31}$": {
"^[A-Za-z0-9_.][A-Za-z0-9_.-]{0,31}$": {
"type": "object",
"properties": {
"uid": {