[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#795954: sysconfig-hardware contains various syntax errors in "case" commands



Package: sysconfig-hardware
Version: 0.0.10+nmu1
Severity: minor
Tags: patch
X-Debbugs-CC: debian-s390@lists.debian.org

The sysconfig-hardware package contains a number of syntax errors in "case"
commands.  The "case" command requires that after each pattern specification
there must be a command list, and this command list must be terminated by
a double semicolon.  This is violated in several places.  In some places,
the only thing between the end of the pattern specification and the double
semicolon is a comment.  A comment is not a list.  A null command (a colon)
will do, but there must be at least one command present to constitute a list.
In other places, there is no double semicolon to terminate the list.  This
also is a violation of the rules of valid syntax.

For some reason, the code has apparently been executing more or less correctly;
but a future release of bash (yes, bash, not dash) may tighten up standards
and the code will fail.  I have attached a patch file which corrects the
problems.

Note: the portion of the patch which changes chandev-convert affects only
the source package.  It is not included in the binary package.

-- 
  .''`.     Stephen Powell    <zlinuxman@wowway.com>
 : :'  :
 `. `'`
   `-
diff -uar a/etc/sysconfig/scripts/hardware/functions b/etc/sysconfig/scripts/hardware/functions
--- a/etc/sysconfig/scripts/hardware/functions	2010-10-30 10:50:49.000000000 -0400
+++ b/etc/sysconfig/scripts/hardware/functions	2015-08-18 05:36:06.411307488 -0400
@@ -27,6 +27,7 @@
       echo "$SCRIPTNAME: illegal option -- $OPTARG" >&2
       echo "Try: \`$SCRIPTNAME -h' for mor information." >&2
       exit $R_USAGE
+      ;;
     esac
   done
 
diff -uar a/etc/sysconfig/scripts/hardware/hwup b/etc/sysconfig/scripts/hardware/hwup
--- a/etc/sysconfig/scripts/hardware/hwup	2010-10-30 10:28:43.000000000 -0400
+++ b/etc/sysconfig/scripts/hardware/hwup	2015-08-18 05:38:22.536360188 -0400
@@ -17,6 +17,7 @@
 case "${STARTMODE:-auto}:$MODE" in
   auto:auto|*:auto-override)
   # Start auto devices in auto and override mode.
+  :
   ;;
   *:auto)
   # Don't display any message if device is not auto in auto mode.
@@ -24,6 +25,7 @@
   ;;
   auto:manual|manual:manual)
   # Start manual devices in manual mode.
+  :
   ;;
   off:manual)
   message "$SCRIPTNAME: used configuration has STARTMODE=$STARTMODE."
@@ -32,6 +34,7 @@
   *)
   message "$SCRIPTNAME: unknown STARTMODE=$STARTMODE."
   exit $R_ERROR
+  ;;
 esac
 
 source $SYSCONFIG/scripts/hardware/$COMMAND-$BUS $ID $DEVPATH
diff -uar a/usr/share/sysconfig/chandev-convert b/usr/share/sysconfig/chandev-convert
--- a/usr/share/sysconfig/chandev-convert	2009-03-24 06:10:51.000000000 -0400
+++ b/usr/share/sysconfig/chandev-convert	2015-08-18 05:40:58.760978505 -0400
@@ -26,6 +26,7 @@
     echo "$SCRIPTNAME: illegal option -- $OPTARG" >&2
     echo "Try: \`$SCRIPTNAME -h' for mor information." >&2
     exit $R_USAGE
+    ;;
   esac
 done
 

Reply to: