Bug 1956228 - Systemctl fail starting service when username starts by a numerical digit.
Summary: Systemctl fail starting service when username starts by a numerical digit.
Keywords:
Status: CLOSED DUPLICATE of bug 1848373
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: systemd
Version: 8.3
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: beta
: ---
Assignee: systemd-maint
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-03 08:49 UTC by Bruno Gillet
Modified: 2021-05-03 11:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-03 11:14:02 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)
Service unit file used to replicate the issue (359 bytes, text/plain)
2021-05-03 08:49 UTC, Bruno Gillet
no flags Details

Description Bruno Gillet 2021-05-03 08:49:10 UTC
Created attachment 1778870 [details]
Service unit file used to replicate the issue

Created attachment 1778870 [details]
Service unit file used to replicate the issue

Description of problem:

When a username starts with numerical digits in a systemd unit file (ie. username = 00abc), systemctl rejects any action on the service with the following error :

Invalid user/group name or numeric ID: 00abc

If user name is reverted to a non numerical prefixed one (ie. abc) service may be managed (start/status/stop) without any problem.

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

systemd 239 (239-41.el8_3.2)
shadow-utils-4.6-11

How reproducible:

Staright forward : Set up an up-to-date RHEL 8.3 VM, create a numerically prefixed user, set a service unit file with that user. Service start or status will fail. Try the same with a non numerically prefixed user, it will work.

Steps to Reproduce:
1. Set up a RHEL8.3 VM, update it.
2. Create a numerically starting user (00git in our replication)
3. Set up a service with this user name (gitea in ur replication)
4. try to get it's status or start it then you will get the following error (from our replication):

[root@rhel83-tst ~]# systemctl status gitea
- gitea.service - Gitea (Git with a cup of tea)
   Loaded: bad-setting (Reason: Unit gitea.service has a bad unit file setting.)
   Active: inactive (dead)

mai 03 04:25:26 rhel83-tst systemd[1]: /usr/lib/systemd/system/gitea.service:9: Invalid user/group name or numeric ID: 00git

5. change user to non numerically starting, then it works (git in our replication)

Actual results:

systemctl fails for managing that service, rejecting the username as invalid.

Expected results:

systemctl should work as planned to start, stop or get a service status.

Additional info:

This is not related to full numeric username that are obviously not supported.
Numerically prefixed username should work.
Attached is the gitea.service unit file used in our replication test.

Comment 1 David Tardon 2021-05-03 11:14:02 UTC

*** This bug has been marked as a duplicate of bug 1848373 ***


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