]> git.ipfire.org Git - thirdparty/systemd.git/commit
shared/user-util: allow usernames with dots in specific fields
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 1 Aug 2019 07:58:27 +0000 (09:58 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 19 Aug 2019 19:19:13 +0000 (21:19 +0200)
commitae480f0b09aec815b64579bb1828ea935d8ee236
tree11e606315ae45e8a9d6718f23a8c10f5048f117a
parent1a29610f5fa1bcb2eeb37d2c6b79d8d1a6dbb865
shared/user-util: allow usernames with dots in specific fields

People do have usernames with dots, and it makes them very unhappy that systemd
doesn't like their that. It seems that there is no actual problem with allowing
dots in the username. In particular chown declares ":" as the official
separator, and internally in systemd we never rely on "." as the seperator
between user and group (nor do we call chown directly). Using dots in the name
is probably not a very good idea, but we don't need to care. Debian tools
(adduser) do not allow users with dots to be created.

This patch allows *existing* names with dots to be used in User, Group,
SupplementaryGroups, SocketUser, SocketGroup fields, both in unit files and on
the command line. DynamicUsers and sysusers still follow the strict policy.
user@.service and tmpfiles already allowed arbitrary user names, and this
remains unchanged.

Fixes #12754.
src/core/dbus-execute.c
src/core/dbus-socket.c
src/core/dbus-util.c
src/core/dbus-util.h
src/core/load-fragment-gperf.gperf.m4
src/core/load-fragment.c
src/core/load-fragment.h