]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
systemd: add "wheel" and "adm" to passwd and group
authorHarald Hoyer <harald@redhat.com>
Mon, 29 Feb 2016 10:52:37 +0000 (11:52 +0100)
committerHarald Hoyer <harald@redhat.com>
Mon, 29 Feb 2016 10:52:37 +0000 (11:52 +0100)
     # LANG=C journalctl -b -u systemd-tmpfiles-setup-dev.service | grep
     # ACL
     Dec 01 13:56:59 localhost.localdomain systemd-tmpfiles[112]: Failed
to parse ACL "d:group:adm:r-x,d:group:wheel:r-x": Invalid argument.
Ignoring
     Dec 01 13:56:59 localhost.localdomain systemd-tmpfiles[112]: Failed
to parse ACL "group:adm:r-x,group:wheel:r-x": Invalid argument. Ignoring
     Dec 01 13:56:59 localhost.localdomain systemd-tmpfiles[112]: Failed
to parse ACL "d:group:adm:r-x,d:group:wheel:r-x": Invalid argument.
Ignoring
     Dec 01 13:56:59 localhost.localdomain systemd-tmpfiles[112]: Failed
to parse ACL "group:adm:r-x,group:wheel:r-x": Invalid argument. Ignoring

     # grep ^[aA] /usr/lib/tmpfiles.d/systemd.conf
     a+ /run/log/journal/%m - - - - d:group:adm:r-x,d:group:wheel:r-x
     A+ /run/log/journal/%m - - - - group:adm:r-x,group:wheel:r-x
     a+ /var/log/journal/%m - - - - d:group:adm:r-x,d:group:wheel:r-x
     A+ /var/log/journal/%m - - - - group:adm:r-x,group:wheel:r-x

https://bugzilla.redhat.com/show_bug.cgi?id=1287537

modules.d/98systemd/module-setup.sh

index a656fe0f1f09cbb0c145ff558dd52bcb87b5b7de..647315f0ef6e6b78a2fbbb2441f81ebc44936f05 100755 (executable)
@@ -22,6 +22,17 @@ installkernel() {
     instmods -s efivarfs
 }
 
+
+ug_check_and_add() {
+    local name="$1"
+    local file="$2"
+
+    if egrep -q "^$name:" "$file" 2>/dev/null \
+            && ! egrep -q "^$name:" "$initdir$file" 2>/dev/null; then
+        egrep "^$name:" "$file" 2>/dev/null >> "$initdir$file"
+    fi
+}
+
 install() {
     local _mods
 
@@ -30,6 +41,12 @@ install() {
         exit 1
     fi
 
+    ug_check_and_add "wheel" "/etc/passwd"
+    ug_check_and_add "wheel" "/etc/group"
+
+    ug_check_and_add "adm" "/etc/passwd"
+    ug_check_and_add "adm" "/etc/group"
+
     inst_multiple -o \
         $systemdutildir/systemd \
         $systemdutildir/systemd-cgroups-agent \