nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0257-docs-Stop-using-polkit-pkexec-for-grub-boot-success..patch

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