| |
@@ -70,9 +70,12 @@
|
| |
eval "arr=( $line )"
|
| |
case "${arr[0]}" in
|
| |
('u')
|
| |
- group "${arr[1]}" "${arr[2]}"
|
| |
- user "${arr[1]}" "${arr[2]}" "${arr[3]}" "${arr[1]}" "${arr[4]}" "${arr[5]}"
|
| |
- # TODO: user:group support
|
| |
+ if [[ "${arr[2]}" == *":"* ]]; then
|
| |
+ user "${arr[1]}" "${arr[2]%:*}" "${arr[3]}" "${arr[2]#*:}" "${arr[4]}" "${arr[5]}"
|
| |
+ else
|
| |
+ group "${arr[1]}" "${arr[2]}"
|
| |
+ user "${arr[1]}" "${arr[2]}" "${arr[3]}" "${arr[1]}" "${arr[4]}" "${arr[5]}"
|
| |
+ fi
|
| |
;;
|
| |
('g')
|
| |
group "${arr[1]}" "${arr[2]}"
|
| |
Hi,
Found out user:group notation is not supported by sysusers.generate-pre.sh while trying to implement/fix the below BZ:
Bug 2139054 - [RFE] cyrus-imapd user systemd-sysusers
For usual services, this is not needed, but cyrus-imapd runs under a different primary group (mail):
The %pre section and related definitions from cyrus-imapd.spec:
When being rewritten to this:
with SOURCE19 containing:
The package installation ends up creating the stuff correctly but only later on with the below preceding error/warning messages:
The patch fixes it for the cyrus-imapd.
Wrote it very quickly so it is likely buggy or not counting with some scenario, but it tries to behave according to a snippet from the documentation:
https://www.freedesktop.org/software/systemd/man/sysusers.d.html#ID
Anyway, we need to implement this as I expect I won't be the only one hitting this at some point. Currently, all BZs which already implemented %sysusers_create_compat macro doesn't use this user:group notation.
Thanks!