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

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