dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0186-01_users-Handle-GRUB_PASSWORD-better.patch

4fe85b
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
4fe85b
From: Peter Jones <pjones@redhat.com>
4fe85b
Date: Fri, 4 Dec 2015 09:28:38 -0500
4fe85b
Subject: [PATCH] 01_users: Handle GRUB_PASSWORD better.
4fe85b
4fe85b
Only handle GRUB_PASSWORD not GRUB2_PASSWORD (as that's more likely to
4fe85b
be acceptable upstream).
4fe85b
4fe85b
Related: rhbz#1284370
4fe85b
4fe85b
Signed-off-by: Peter Jones <pjones@redhat.com>
4fe85b
---
4fe85b
 util/grub-setpassword.8 | 2 +-
4fe85b
 util/grub.d/01_users.in | 2 +-
4fe85b
 2 files changed, 2 insertions(+), 2 deletions(-)
4fe85b
4fe85b
diff --git a/util/grub-setpassword.8 b/util/grub-setpassword.8
4fe85b
index 5973abef4ab..49200a848b7 100644
4fe85b
--- a/util/grub-setpassword.8
4fe85b
+++ b/util/grub-setpassword.8
4fe85b
@@ -9,7 +9,7 @@
4fe85b
 \fBgrub-setpassword\fR outputs the user.cfg file which contains the hashed GRUB bootloader password. This utility only supports configurations where there is a single root user.
4fe85b
 
4fe85b
 The file has the format:
4fe85b
-GRUB_2PASSWORD=<\fIhashed password\fR>.
4fe85b
+GRUB2_PASSWORD=<\fIhashed password\fR>.
4fe85b
 
4fe85b
 .SH OPTIONS
4fe85b
 .TP
4fe85b
diff --git a/util/grub.d/01_users.in b/util/grub.d/01_users.in
4fe85b
index facd409e722..db2f44bfb78 100644
4fe85b
--- a/util/grub.d/01_users.in
4fe85b
+++ b/util/grub.d/01_users.in
4fe85b
@@ -2,7 +2,7 @@
4fe85b
 cat << EOF
4fe85b
 if [ -f \${prefix}/user.cfg ]; then
4fe85b
   source \${prefix}/user.cfg
4fe85b
-  if [ -n \${GRUB2_PASSWORD} ]; then
4fe85b
+  if [ -n "\${GRUB2_PASSWORD}" ]; then
4fe85b
     set superusers="root"
4fe85b
     export superusers
4fe85b
     password_pbkdf2 root \${GRUB2_PASSWORD}