update_flash is /bin/sh but contains bash

Bug #1371624 reported by Scott Moser
This bug report is a duplicate of:  Bug #1366986: bashisms in update_firmware. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
powerpc-ibm-utils (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

$ sudo update_flash
/usr/sbin/update_flash_nv: 375: [: root: unexpected operator
update_flash: Must be root to execute this command.

The fix is fairly straight forward:
$ for f in /usr/sbin/update_flash_nv /usr/sbin/update_flash; do diff -u $f.dist $f; done
--- /usr/sbin/update_flash_nv.dist 2014-09-19 14:25:10.791598073 +0000
+++ /usr/sbin/update_flash_nv 2014-09-19 14:25:18.871598451 +0000
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # Copyright (c) 2013 International Business Machines
 # Common Public License Version 1.0 (see COPYRIGHT)
 #
--- /usr/sbin/update_flash.dist 2014-09-19 14:23:26.421598067 +0000
+++ /usr/sbin/update_flash 2014-09-19 14:26:03.061598078 +0000
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # Copyright (c) 2003, 2004, 2008 International Business Machines
 # Common Public License Version 1.0 (see COPYRIGHT)
 #
@@ -418,7 +418,7 @@
        if [ ! -r "$UPDATE_FLASH_NV" ]; then
                error $E_PERM "Couldn't find $UPDATE_FLASH_NV file."
        fi
- /bin/sh $UPDATE_FLASH_NV $@
+ /bin/bash $UPDATE_FLASH_NV $@
        exit $?
 esac

The one questionable change there is to still invoke UPDATE_FLASH_NV as '/bin/<something>' rather than expecting it to be executable and letting its #! do the work.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: powerpc-ibm-utils 1.2.20-1
ProcVersionSignature: Ubuntu 3.13.0-35.62-generic 3.13.11.6
Uname: Linux 3.13.0-35-generic ppc64le
ApportVersion: 2.14.1-0ubuntu3.4
Architecture: ppc64el
Date: Fri Sep 19 14:22:39 2014
ProcEnviron:
 TERM=screen
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: powerpc-ibm-utils
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Scott Moser (smoser) wrote :
Scott Moser (smoser)
Changed in powerpc-ibm-utils (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.