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

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