Blame SOURCES/0271-Fix-grub-setpassword-o-s-output-path.patch

28f7f8
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
28f7f8
From: Andy Lutomirski <luto@kernel.org>
28f7f8
Date: Sun, 11 Jun 2017 19:17:40 -0400
28f7f8
Subject: [PATCH] Fix grub-setpassword -o's output path
28f7f8
28f7f8
The output path is set up in the command line parsing, but completely ignored
28f7f8
in the code that actually writes the files.  This patch fixes that.
28f7f8
28f7f8
Signed-off-by: Peter Jones <pjones@redhat.com>
28f7f8
---
28f7f8
 util/grub-setpassword.in | 8 ++++----
28f7f8
 1 file changed, 4 insertions(+), 4 deletions(-)
28f7f8
28f7f8
diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in
28f7f8
index d7924af5192..9ca7114f904 100755
28f7f8
--- a/util/grub-setpassword.in
28f7f8
+++ b/util/grub-setpassword.in
28f7f8
@@ -117,11 +117,11 @@ fi
28f7f8
 
28f7f8
 # on the ESP, these will fail to set the permissions, but it's okay because
28f7f8
 # the directory is protected.
28f7f8
-install -m 0600 /dev/null "${grubdir}/user.cfg" 2>/dev/null || :
28f7f8
-chmod 0600 "${grubdir}/user.cfg" 2>/dev/null || :
28f7f8
-echo "GRUB2_PASSWORD=${MYPASS}" > "${grubdir}/user.cfg"
28f7f8
+install -m 0600 /dev/null "${OUTPUT_PATH}/user.cfg" 2>/dev/null || :
28f7f8
+chmod 0600 "${OUTPUT_PATH}/user.cfg" 2>/dev/null || :
28f7f8
+echo "GRUB2_PASSWORD=${MYPASS}" > "${OUTPUT_PATH}/user.cfg"
28f7f8
 
28f7f8
-if ! grep -q "^### BEGIN /etc/grub.d/01_users ###$" "${grubdir}/grub.cfg"; then
28f7f8
+if ! grep -q "^### BEGIN /etc/grub.d/01_users ###$" "${OUTPUT_PATH}/grub.cfg"; then
28f7f8
     echo "WARNING: The current configuration lacks password support!"
28f7f8
     echo "Update your configuration with @grub_mkconfig@ to support this feature."
28f7f8
 fi