nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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