[Bug 1371624] [NEW] update_flash is /bin/sh but contains bash

Scott Moser smoser at ubuntu.com
Fri Sep 19 14:27:20 UTC 2014


Public bug reported:

$ 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)

** Affects: powerpc-ibm-utils (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug ppc64el trusty uec-images

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to powerpc-ibm-utils in Ubuntu.
https://bugs.launchpad.net/bugs/1371624

Title:
  update_flash is /bin/sh but contains bash

Status in “powerpc-ibm-utils” package in Ubuntu:
  New

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)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/powerpc-ibm-utils/+bug/1371624/+subscriptions



More information about the foundations-bugs mailing list