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