View Issue Details

IDProjectCategoryView StatusLast Update
0003588GNUnetgnunet-setuppublic2018-06-07 00:25
ReporterrbalintAssigned ToChristian Grothoff 
PrioritylowSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSDebianOS Version7.0
Product VersionSVN HEAD 
Target Version0.11.0pre66Fixed in Version0.11.0pre66 
Summary0003588: Bashisms in some scripts
DescriptionFrom https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=7772233:

Hi,

I've ran checkbashisms (from the 'devscripts' package) over the whole
archive and I found that your package has a /bin/sh script that uses a
"bashism".

checkbashisms' output:
> possible bashism in ./usr/bin/gnunet-gns-import line 29 (should be
> VAR="${VAR}foo"):
> options+="-c $OPTARG"
> possible bashism in ./usr/bin/gnunet-gns-proxy-setup-ca line 11 (should be
> VAR="${VAR}foo"):
> options+="-c $OPTARG"
> possible bashism in ./usr/bin/gnunet-gns-proxy-setup-ca line 42 (should be
> >word 2>&1):
> certutil -D -n "GNS Proxy CA" -d ~/.mozilla/firefox/*.default
> >/dev/null 2&>1
> possible bashism in ./usr/bin/gnunet-gns-proxy-setup-ca line 49 (should be
> >word 2>&1):
> certutil -D -n "GNS Proxy CA" -d ~/.pki/nssdb >/dev/null 2&>1


Not using bash (or a Debian Policy compliant shell interpreter that doesn't
provide such an extra feature) as /bin/sh is likely to lead to errors or
unexpected behaviours. Please be aware that dash is the default /bin/sh.

Please closely examine the above output and the script, and determine
what the proper severity of the bug is, and adjust it accordingly. If
it's important or greater please hurry to get this fixed for jessie.

Hints about how to fix bashisms can be found at:
https://wiki.ubuntu.com/DashAsBinSh

Thanks in advance,
Raphael Geissert
TagsNo tags attached.

Activities

rbalint

2014-12-20 09:59

reporter  

fix-bashism.patch (1,686 bytes)
Description: fix bashisms
Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=7772233
Author: Raphael Geissert <geissert@debian.org>
Index: gnunet-0.10.1-2/src/gns/gnunet-gns-proxy-setup-ca
===================================================================
--- gnunet-0.10.1-2/src/gns/gnunet-gns-proxy-setup-ca
+++ gnunet-0.10.1-2/src/gns/gnunet-gns-proxy-setup-ca
@@ -7,9 +7,9 @@
 options=''
 while getopts "c:" opt; do
   case $opt in
     c)
+      options="$options -c $OPTARG"
-      options+="-c $OPTARG"
       ;;
     \?)
       echo "Invalid option: -$OPTARG" >&2
       exit 1
@@ -38,16 +38,16 @@
 for f in ~/.mozilla/firefox/*.default
 do
   if [ -d $f ]; then
     echo "Importing CA info Firefox $f"
+    certutil -D -n "GNS Proxy CA" -d ~/.mozilla/firefox/*.default >/dev/null 2>&1
-    certutil -D -n "GNS Proxy CA" -d ~/.mozilla/firefox/*.default >/dev/null 2&>1
     certutil -A -n "GNS Proxy CA" -t CT,, -d ~/.mozilla/firefox/*.default < $GNSCERT
   fi
 done
 
 if [ -d ~/.pki/nssdb ]; then
   echo "Importing CA into Chrome"
+  certutil -D -n "GNS Proxy CA" -d ~/.pki/nssdb >/dev/null 2>&1
-  certutil -D -n "GNS Proxy CA" -d ~/.pki/nssdb >/dev/null 2&>1
   certutil -A -n "GNS Proxy CA" -t CT,, -d ~/.pki/nssdb < $GNSCERT
 fi
 
 
Index: gnunet-0.10.1-2/contrib/gnunet-gns-import.sh
===================================================================
--- gnunet-0.10.1-2/contrib/gnunet-gns-import.sh
+++ gnunet-0.10.1-2/contrib/gnunet-gns-import.sh
@@ -25,9 +25,9 @@
 
 while getopts "c:" opt; do
   case $opt in
     c)
+      options="$options -c $OPTARG"
-      options+="-c $OPTARG"
       ;;
     \?)
       echo "Invalid option: -$OPTARG" >&2
       exit 1
fix-bashism.patch (1,686 bytes)

rbalint

2014-12-20 10:39

reporter   ~0008717

The correct Debian BTS URL is https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=772233

Christian Grothoff

2014-12-20 13:00

manager   ~0008718

Fixed in SVN 34732 (as suggested, modulo minor merge conflict as one of the 3 instances was already fixed).

Issue History

Date Modified Username Field Change
2014-12-20 09:59 rbalint New Issue
2014-12-20 09:59 rbalint File Added: fix-bashism.patch
2014-12-20 10:39 rbalint Note Added: 0008717
2014-12-20 13:00 Christian Grothoff Note Added: 0008718
2014-12-20 13:00 Christian Grothoff Status new => resolved
2014-12-20 13:00 Christian Grothoff Fixed in Version => 0.11.0pre66
2014-12-20 13:00 Christian Grothoff Resolution open => fixed
2014-12-20 13:00 Christian Grothoff Assigned To => Christian Grothoff
2014-12-20 13:00 Christian Grothoff Target Version => 0.11.0pre66
2018-06-07 00:25 Christian Grothoff Status resolved => closed