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