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