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

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