RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1869432 - useradd clarify man page usage regarding period in username
Summary: useradd clarify man page usage regarding period in username
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: shadow-utils
Version: 8.3
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: 8.0
Assignee: Iker Pedrosa
QA Contact: shridhar
URL:
Whiteboard: sync-to-jira qetodo
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-18 00:41 UTC by adam.c.scott
Modified: 2021-05-18 15:00 UTC (History)
5 users (show)

Fixed In Version: shadow-utils-4.6-12.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-18 14:59:58 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:1650 0 None None None 2021-05-18 15:00:03 UTC

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


Note You need to log in before you can comment on or make changes to this bug.