a0a3b4
From ba977abe6305b23fb2bec41798259a78185abaaa Mon Sep 17 00:00:00 2001
a0a3b4
From: Harald Hoyer <harald@redhat.com>
a0a3b4
Date: Mon, 29 Feb 2016 11:52:37 +0100
a0a3b4
Subject: [PATCH] systemd: add "wheel" and "adm" to passwd and group
a0a3b4
a0a3b4
     # LANG=C journalctl -b -u systemd-tmpfiles-setup-dev.service | grep
a0a3b4
     # ACL
a0a3b4
     Dec 01 13:56:59 localhost.localdomain systemd-tmpfiles[112]: Failed
a0a3b4
to parse ACL "d:group:adm:r-x,d:group:wheel:r-x": Invalid argument.
a0a3b4
Ignoring
a0a3b4
     Dec 01 13:56:59 localhost.localdomain systemd-tmpfiles[112]: Failed
a0a3b4
to parse ACL "group:adm:r-x,group:wheel:r-x": Invalid argument. Ignoring
a0a3b4
     Dec 01 13:56:59 localhost.localdomain systemd-tmpfiles[112]: Failed
a0a3b4
to parse ACL "d:group:adm:r-x,d:group:wheel:r-x": Invalid argument.
a0a3b4
Ignoring
a0a3b4
     Dec 01 13:56:59 localhost.localdomain systemd-tmpfiles[112]: Failed
a0a3b4
to parse ACL "group:adm:r-x,group:wheel:r-x": Invalid argument. Ignoring
a0a3b4
a0a3b4
     # grep ^[aA] /usr/lib/tmpfiles.d/systemd.conf
a0a3b4
     a+ /run/log/journal/%m - - - - d:group:adm:r-x,d:group:wheel:r-x
a0a3b4
     A+ /run/log/journal/%m - - - - group:adm:r-x,group:wheel:r-x
a0a3b4
     a+ /var/log/journal/%m - - - - d:group:adm:r-x,d:group:wheel:r-x
a0a3b4
     A+ /var/log/journal/%m - - - - group:adm:r-x,group:wheel:r-x
a0a3b4
a0a3b4
https://bugzilla.redhat.com/show_bug.cgi?id=1287537
a0a3b4
---
a0a3b4
 modules.d/98systemd/module-setup.sh | 17 +++++++++++++++++
a0a3b4
 1 file changed, 17 insertions(+)
a0a3b4
a0a3b4
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
1755ca
index a656fe0f..647315f0 100755
a0a3b4
--- a/modules.d/98systemd/module-setup.sh
a0a3b4
+++ b/modules.d/98systemd/module-setup.sh
a0a3b4
@@ -22,6 +22,17 @@ installkernel() {
a0a3b4
     instmods -s efivarfs
a0a3b4
 }
a0a3b4
 
a0a3b4
+
a0a3b4
+ug_check_and_add() {
a0a3b4
+    local name="$1"
a0a3b4
+    local file="$2"
a0a3b4
+
a0a3b4
+    if egrep -q "^$name:" "$file" 2>/dev/null \
a0a3b4
+            && ! egrep -q "^$name:" "$initdir$file" 2>/dev/null; then
a0a3b4
+        egrep "^$name:" "$file" 2>/dev/null >> "$initdir$file"
a0a3b4
+    fi
a0a3b4
+}
a0a3b4
+
a0a3b4
 install() {
a0a3b4
     local _mods
a0a3b4
 
a0a3b4
@@ -30,6 +41,12 @@ install() {
a0a3b4
         exit 1
a0a3b4
     fi
a0a3b4
 
a0a3b4
+    ug_check_and_add "wheel" "/etc/passwd"
a0a3b4
+    ug_check_and_add "wheel" "/etc/group"
a0a3b4
+
a0a3b4
+    ug_check_and_add "adm" "/etc/passwd"
a0a3b4
+    ug_check_and_add "adm" "/etc/group"
a0a3b4
+
a0a3b4
     inst_multiple -o \
a0a3b4
         $systemdutildir/systemd \
a0a3b4
         $systemdutildir/systemd-cgroups-agent \