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

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