Bug 1294407 - /usr/sbin/grub2-setpassword from grub2-tools-2.02-0.25.fc23.x86_64 incorrectly implements the custom output option
/usr/sbin/grub2-setpassword from grub2-tools-2.02-0.25.fc23.x86_64 incorrectl...
Status: CLOSED DUPLICATE of bug 1292336
Product: Fedora
Classification: Fedora
Component: grub2 (Show other bugs)
23
x86_64 Linux
unspecified Severity low
: ---
: ---
Assigned To: rmarshall
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-27 23:51 EST by major
Modified: 2016-02-22 15:23 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-22 15:23:55 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description major 2015-12-27 23:51:37 EST
Description of problem:
/usr/sbin/grub2-setpassword from grub2-tools-2.02-0.25.fc23.x86_64 incorrectly implements the custom output option. The following diff changes should be implemented. I have not exhaustively tested the changes.

####################
[root@chariot ~]# diff -u /usr/sbin/grub2-setpassword.BAD /usr/sbin/grub2-setpassword
--- /usr/sbin/grub2-setpassword.BAD     2015-12-10 14:04:26.000000000 -0600
+++ /usr/sbin/grub2-setpassword 2015-12-27 22:35:36.609321870 -0600
@@ -1,7 +1,7 @@
 #!/bin/sh -e
 
 if [ -d /sys/firmware/efi/efivars/ ]; then
-    grubdir=`echo "/boot/efi/EFI/redhat/" | sed 's,//*,/,g'`
+    grubdir=`echo "/boot/efi/EFI/fedora/" | sed 's,//*,/,g'`
 else
     grubdir=`echo "/boot/grub2" | sed 's,//*,/,g'`
 fi
@@ -61,10 +61,10 @@
     -v | --version)
        echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
        exit 0 ;;
-    -o | --output)
+    -o | --output_path)
         OUTPUT_PATH=`argument $option "$@"`; shift ;;
-    --output=*)
-        OUTPUT_PATH=`echo "$option" | sed 's/--output=//'` ;;
+    --output_path=*)
+        OUTPUT_PATH=`echo "$option" | sed 's/--output_path=//'` ;;
     -o=*)
         OUTPUT_PATH=`echo "$option" | sed 's/-o=//'` ;;
     esac
@@ -118,6 +118,6 @@
 
 # on the ESP, these will fail to set the permissions, but it's okay because
 # the directory is protected.
-install -m 0600 /dev/null "${grubdir}/user.cfg" 2>/dev/null || :
-chmod 0600 "${grubdir}/user.cfg" 2>/dev/null || :
-echo "GRUB2_PASSWORD=${MYPASS}" > "${grubdir}/user.cfg"
+install -m 0600 /dev/null "${OUTPUT_PATH}/user.cfg" 2>/dev/null || :
+chmod 0600 "${OUTPUT_PATH}/user.cfg" 2>/dev/null || :
+echo "GRUB2_PASSWORD=${MYPASS}" > "${OUTPUT_PATH}/user.cfg"
####################

Version-Release number of selected component (if applicable):
grub2-tools-2.02-0.25.fc23.x86_64
Comment 1 rmarshall 2016-02-22 15:23:55 EST

*** This bug has been marked as a duplicate of bug 1292336 ***

Note You need to log in before you can comment on or make changes to this bug.