Blame SOURCES/0366-systemd-add-wheel-and-adm-to-passwd-and-group.patch

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