Bug 1869432

Summary: useradd clarify man page usage regarding period in username
Product: Red Hat Enterprise Linux 8 Reporter: adam.c.scott
Component: shadow-utilsAssignee: Iker Pedrosa <ipedrosa>
Status: CLOSED ERRATA QA Contact: shridhar <sgadekar>
Severity: low Docs Contact:
Priority: low    
Version: 8.3CC: dapospis, dlavu, pbrezina, sgadekar, sgoveas
Target Milestone: rcKeywords: ManPageChange, Triaged
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sync-to-jira qetodo
Fixed In Version: shadow-utils-4.6-12.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 14:59:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description adam.c.scott 2020-08-18 00:41:57 UTC
Description of problem:
man page does not explicitly state clearly that a period is allowed in the username:

useradd man page section 8
"Usernames may contain only lower and upper case letters, digits, underscores, or dashes. They can end with a dollar sign. Dashes are not allowed at the beginning of the username. Fully numeric usernames and usernames . or .. are also disallowed. It is not recommended to use usernames beginning with . character as their home directories will be hidden in the ls output. In regular expression terms: [a-zA-Z0-9_.][a-zA-Z0-9_.-]*[$]?"


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.man useradd /CAVEATS


Actual results:


Expected results:


Additional info:

Comment 2 Iker Pedrosa 2020-08-19 08:08:34 UTC
Taking into account that the bug doesn't seem critical and RHEL7 life cycle, I'm moving it to RHEL8.

Comment 6 shridhar 2020-11-05 10:52:31 UTC
Tested with following:

]# rpm -q shadow-utils
shadow-utils-4.6-12.el8.x86_64

#\] man useradd
<snip>
CAVEATS
       You may not add a user to a NIS or LDAP group. This must be performed on the corresponding server.

       Similarly, if the username already exists in an external user database such as NIS or LDAP, useradd will deny the user account creation request.

       Usernames may begin with lower and upper case letters, digits, underscores, or periods. They may continue with all the aforementioned characters, or dashes. Finally, they can end with a dollar sign.
       Fully numeric usernames and usernames containing only . or .. are disallowed. It is not recommended to use usernames beginning with . character as their home directories will be hidden in the ls
       output. In regular expression terms: [a-zA-Z0-9_.][a-zA-Z0-9_.-]*[$]?

       Usernames may only be up to 32 characters long.
</snip>

Above snippet clearly mentions that a period sign could be part of username. That username may begin with a period sign(.) and may continue have a period sign afterward as well. Also a caution is give about why '.' and '..' should not be at start of username.
Marking verified.

Comment 10 shridhar 2020-11-30 14:16:06 UTC
.d]# rpm -q shadow-utils
shadow-utils-4.6-12.el8.x86_64

] man useradd
<snip>
CAVEATS
       You may not add a user to a NIS or LDAP group. This must be performed on the corresponding server.

       Similarly, if the username already exists in an external user database such as NIS or LDAP, useradd will deny the user account creation request.

       Usernames may begin with lower and upper case letters, digits, underscores, or periods. They may continue with all the aforementioned characters, or dashes. Finally, they can end with a dollar sign.
       Fully numeric usernames and usernames containing only . or .. are disallowed. It is not recommended to use usernames beginning with . character as their home directories will be hidden in the ls
       output. In regular expression terms: [a-zA-Z0-9_.][a-zA-Z0-9_.-]*[$]?

       Usernames may only be up to 32 characters long.
</snip>

Above snippet clearly mentions that a period sign could be part of username. That username may begin with a period sign(.) and may continue have a period sign afterward as well. Also a caution is give about why '.' and '..' should not be at start of username.
Marking verified.

Comment 13 errata-xmlrpc 2021-05-18 14:59:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (shadow-utils bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1650