bb02e16
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
bb02e16
From: Hans de Goede <hdegoede@redhat.com>
bb02e16
Date: Fri, 14 Sep 2018 16:39:40 +0200
bb02e16
Subject: [PATCH] docs: Stop using polkit / pkexec for grub-boot-success.timer
bb02e16
 / service
bb02e16
bb02e16
We also want to call grub2-set-bootflag under gdm and pkexec does not
bb02e16
work under gdm because the gdm user has /sbin/nologin as shell.
bb02e16
bb02e16
So instead we are going to install grub2-set-bootflag as suid root,
bb02e16
grub2-set-bootflag was written with this usage in mind, so is safe
bb02e16
to be made suid root.
bb02e16
bb02e16
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
bb02e16
---
bb02e16
 docs/grub-boot-success.service |  2 +-
bb02e16
 docs/grub-boot-success.timer   |  1 -
bb02e16
 docs/org.gnu.grub.policy       | 20 --------------------
bb02e16
 3 files changed, 1 insertion(+), 22 deletions(-)
bb02e16
 delete mode 100644 docs/org.gnu.grub.policy
bb02e16
bb02e16
diff --git a/docs/grub-boot-success.service b/docs/grub-boot-success.service
bb02e16
index c8c91c34d49..80e79584c91 100644
bb02e16
--- a/docs/grub-boot-success.service
bb02e16
+++ b/docs/grub-boot-success.service
bb02e16
@@ -3,4 +3,4 @@ Description=Mark boot as successful
bb02e16
 
bb02e16
 [Service]
bb02e16
 Type=oneshot
bb02e16
-ExecStart=/usr/bin/pkexec /usr/sbin/grub2-set-bootflag boot_success
bb02e16
+ExecStart=/usr/sbin/grub2-set-bootflag boot_success
bb02e16
diff --git a/docs/grub-boot-success.timer b/docs/grub-boot-success.timer
bb02e16
index 67bd829b795..5d8fcba21aa 100644
bb02e16
--- a/docs/grub-boot-success.timer
bb02e16
+++ b/docs/grub-boot-success.timer
bb02e16
@@ -1,7 +1,6 @@
bb02e16
 [Unit]
bb02e16
 Description=Mark boot as successful after the user session has run 2 minutes
bb02e16
 ConditionUser=!@system
bb02e16
-ConditionPathExists=/usr/bin/pkexec
bb02e16
 
bb02e16
 [Timer]
bb02e16
 OnActiveSec=2min
bb02e16
diff --git a/docs/org.gnu.grub.policy b/docs/org.gnu.grub.policy
bb02e16
deleted file mode 100644
bb02e16
index 18391efc8e7..00000000000
bb02e16
--- a/docs/org.gnu.grub.policy
bb02e16
+++ /dev/null
bb02e16
@@ -1,20 +0,0 @@
bb02e16
-
bb02e16
-
bb02e16
-<policyconfig>
bb02e16
-  <vendor>GNU GRUB</vendor>
bb02e16
-  <vendor_url>https://www.gnu.org/software/grub/</vendor_url>
bb02e16
-  <action id="org.gnu.grub.set-bootflag">
bb02e16
-    
bb02e16
-          - A normal active user on the local machine does not need permission
bb02e16
-            to set bootflags to show the menu / mark current boot successful.
bb02e16
-     -->
bb02e16
-    <description>Set GRUB bootflags</description>
bb02e16
-    <message>Authentication is required to modify the bootloaders bootflags</message>
bb02e16
-    <defaults>
bb02e16
-      <allow_any>no</allow_any>
bb02e16
-      <allow_inactive>no</allow_inactive>
bb02e16
-      <allow_active>yes</allow_active>
bb02e16
-    </defaults>
bb02e16
-    <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/grub2-set-bootflag</annotate>
bb02e16
-  </action>
bb02e16
-</policyconfig>