Bug 1294407 - /usr/sbin/grub2-setpassword from grub2-tools-2.02-0.25.fc23.x86_64 incorrectly implements the custom output option
Summary: /usr/sbin/grub2-setpassword from grub2-tools-2.02-0.25.fc23.x86_64 incorrectl...
Keywords:
Status: CLOSED DUPLICATE of bug 1292336
Alias: None
Product: Fedora
Classification: Fedora
Component: grub2
Version: 23
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: rmarshall
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-28 04:51 UTC by major
Modified: 2016-02-22 20:23 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-22 20:23:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description major 2015-12-28 04:51:37 UTC
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 20:23:55 UTC

*** 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.