Commit Graph

10 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
66144f688d sysusers.generate-pre.sh: properly escape quotes in description strings
... (rhbz#2104141)

In the first version, I wanted to use POSIX quotes with $''. But that required
'printf %q', which brings in a dependency on coreutils.

Following mcr0mmand's suggestion, ${foo@Q} is used instead, which should work
equivalently, and does not require anything new.

Tested with 'sysusers.generate-pre.sh /usr/lib/sysusers.d/*conf'. The output is
the same before and after, apart from the dovecot user with a quote.

rhel-only

Resolves: #2217149
2023-06-29 15:29:04 +02:00
Zbigniew Jędrzejewski-Szmek
00374b7b6e sysusers.generate-pre.sh: fix indentation in generated scripts
We need to use a mix of spaces and tabs: the tabs are removed because of -EOF,
and then the spaces indent the output. Jesus.

rhel-only

Resolves: #2217149
2023-06-29 15:29:04 +02:00
Martin Osvald
b99e4e7874 Support user:group notation by sysusers.generate-pre.sh script
#Type Name       ID                  GECOS              Home directory Shell
u     user_name  uid:gid             "User Description" /home/dir      /path/to/shell

According to: https://www.freedesktop.org/software/systemd/man/sysusers.d.html

rhel-only

Resolves: #2217149
2023-06-29 15:27:54 +02:00
Zbigniew Jędrzejewski-Szmek
302add7ebd Fix indentation in %sysusers_create_compat macro (rhbz#2132835)
Automatic unindentation after <<-EOF only works with tabs. Jesus.

rhel-only

Resolves: #2217149
2023-06-29 15:24:37 +02:00
Luca BRUNO
7c2e28783a sysusers/generate: bridge 'm' entries to usermod
This tweaks the sysusers.d handling logic so that 'm' entries are
now translated to a series of groupadd + useradd + usermod call.
The last usermod call is the notable change, effectively affecting
the list of secondary groups now.

rhel-only

Resolves: #2217149
2023-06-29 15:24:30 +02:00
Luca BRUNO
83d62beefc Align sysusers-generated shell value with upstream systemd default
rhel-only

Resolves: #2217149
2023-06-29 15:24:24 +02:00
Zbigniew Jędrzejewski-Szmek
1a82a5d221 Supress errors from useradd/groupadd
rhel-only

Resolves: #2217149
2023-06-29 15:24:19 +02:00
Zbigniew Jędrzejewski-Szmek
eac5440e8e Shellcheckify sysusers.generate-pre.sh
There should be almost no functional change, but shellcheck complains
less. User/group descriptions with escaped characters are handled
properly.

rhel-only

Resolves: #2217149
2023-06-29 15:24:11 +02:00
Zbigniew Jędrzejewski-Szmek
42b42fd61e sysusers.generate-pre: indentation
rhel-only

Resolves: #2217149
2023-06-29 15:24:04 +02:00
Troy Dawson
6c3148f502 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/systemd#14b2fafb3688a4170a9c15235d1c3feb7ddeaf9d
2020-10-15 10:17:11 -07:00