Blame SOURCES/0188-Warn-if-grub-password-will-not-be-read-1290803.patch

6b3c76
From f611a1e2fac218dcae62dbde553045b25b12c724 Mon Sep 17 00:00:00 2001
a85e8e
From: Robert Marshall <rmarshall@redhat.com>
a85e8e
Date: Mon, 22 Feb 2016 15:30:05 -0500
6b3c76
Subject: [PATCH 188/261] Warn if grub password will not be read (#1290803)
a85e8e
a85e8e
It is possible for a system to have never run grub-mkconfig and add the
a85e8e
section that reads the user.cfg file which contains a user set GRUB
a85e8e
password. Users in that scenario will now be warned that grub-mkconfig
a85e8e
must be run prior to their newly set password taking effect.
a85e8e
a85e8e
Resolves: rhbz#1290803
a85e8e
---
a85e8e
 util/grub-setpassword.in | 5 +++++
a85e8e
 1 file changed, 5 insertions(+)
a85e8e
a85e8e
diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in
6b3c76
index dd76f00fc..fb9d3a3b6 100755
a85e8e
--- a/util/grub-setpassword.in
a85e8e
+++ b/util/grub-setpassword.in
a85e8e
@@ -121,3 +121,8 @@ fi
a85e8e
 install -m 0600 /dev/null "${grubdir}/user.cfg" 2>/dev/null || :
a85e8e
 chmod 0600 "${grubdir}/user.cfg" 2>/dev/null || :
a85e8e
 echo "GRUB2_PASSWORD=${MYPASS}" > "${grubdir}/user.cfg"
a85e8e
+
a85e8e
+if ! grep -q "^### BEGIN /etc/grub.d/01_users ###$" "${grubdir}/grub.cfg"; then
a85e8e
+    echo "WARNING: The current configuration lacks password support!"
a85e8e
+    echo "Update your configuration with @grub_mkconfig@ to support this feature."
a85e8e
+fi
6b3c76
-- 
6b3c76
2.13.5
6b3c76