[Pkg-fedora-ds-maintainers] Bug#772195: 389-ds-base: bashism in /bin/sh script

Raphael Geissert geissert at debian.org
Fri Dec 5 23:57:36 UTC 2014


Package: 389-ds-base
Severity: serious
Version: 1.3.3.5-2
User: debian-release at lists.debian.org
Usertags: goal-dash

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/sbin/saveconfig line 34 (should be 'b = a'):
> if [ $? == 1 ]
> possible bashism in ./usr/sbin/dn2rdn line 42 (should be 'b = a'):
> if [ $? == 1 ]
> possible bashism in ./usr/sbin/dbverify line 48 (should be 'b = a'):
> if [ $? == 1 ]
> possible bashism in ./usr/sbin/dbverify line 59 (should be 'b = a'):
> if [ $display_version == "yes" ]; then
> possible bashism in ./usr/sbin/restoreconfig line 34 (should be 'b = a'):
> if [ $? == 1 ]
> possible bashism in ./usr/sbin/suffix2instance line 35 (should be 'b = a'):
> if [ "$args" == "" ]
> possible bashism in ./usr/sbin/suffix2instance line 42 (should be 'b = a'):
> if [ $? == 1 ]
> possible bashism in ./usr/sbin/vlvindex line 48 (should be 'b = a'):
> if [ $? == 1 ]
> possible bashism in ./usr/sbin/bak2db line 61 (should be 'b = a'):
> if [ $? == 1 ]
> possible bashism in ./usr/sbin/stop-dirsrv line 42 (should be 'b = a'):
>     if [ -d "/lib/systemd/system" ] && [ "$(id -u)" == "0" ];then
> possible bashism in ./usr/sbin/ldif2ldap line 43 (should be 'b = a'):
> if [ "$input_file" == "" ]
> possible bashism in ./usr/sbin/ldif2ldap line 50 (should be 'b = a'):
> if [ $? == 1 ]
> possible bashism in ./usr/sbin/ldif2ldap line 70 (should be 'b = a'):
> if [ "$rootdn" == "" ]; then
> possible bashism in ./usr/sbin/ldif2ldap line 102 (should be 'b = a'):
> if [ "$security" == "on" ]; then
> possible bashism in ./usr/sbin/ldif2ldap line 103 (should be 'b = a'):
>     if [ "$protocol" == "STARTTLS" ] || [ "$protocol" == "" ]; then
> possible bashism in ./usr/sbin/ldif2ldap line 104 (should be 'b = a'):
>	  if [ "$error" == "yes" ]; then 
> possible bashism in ./usr/sbin/ldif2ldap line 107 (should be 'b = a'):
>	  if [ "$openldap" == "yes" ]; then
> possible bashism in ./usr/sbin/ldif2ldap line 119 (should be 'b = a'):
> if [ "$security" == "on" ]; then
> possible bashism in ./usr/sbin/ldif2ldap line 120 (should be 'b = a'):
>     if [ "$protocol" == "LDAPS" ] || [ "$protocol" == "" ]; then
> possible bashism in ./usr/sbin/ldif2ldap line 121 (should be 'b = a'):
>	  if [ "$error" == "yes" ]; then 
> possible bashism in ./usr/sbin/ldif2ldap line 124 (should be 'b = a'):
>	  if [ "$openldap" == "yes" ]; then
> possible bashism in ./usr/sbin/ldif2ldap line 136 (should be 'b = a'):
> if [ "$ldapi" == "on" ] && [ "$openldap" == "yes" ]; then
> possible bashism in ./usr/sbin/ldif2ldap line 137 (should be 'b = a'):
>     if [ "$protocol" == "LDAPI" ] || [ "$protocol" == "" ]; then
> possible bashism in ./usr/sbin/ldif2ldap line 138 (should be 'b = a'):
>	  if [ "$(id -u)" == "0" ] && [ "$autobind" == "on" ]; then
> possible bashism in ./usr/sbin/ldif2ldap line 139 (should be 'b = a'):
>	      if [ "$error" == "yes" ]; then 
> possible bashism in ./usr/sbin/ldif2ldap line 144 (should be 'b = a'):
>	      if [ "$error" == "yes" ]; then 
> possible bashism in ./usr/sbin/ldif2ldap line 161 (should be 'b = a'):
> if [ "$protocol" == "LDAP" ] || [ "$protocol" == "" ]; then
> possible bashism in ./usr/sbin/ldif2ldap line 162 (should be 'b = a'):
>     if [ "$error" == "yes" ]; then 
> possible bashism in ./usr/sbin/ldif2ldap line 165 (should be 'b = a'):
>     if [ "$openldap" == "yes" ]; then
> possible bashism in ./usr/sbin/ldif2db line 85 (should be 'b = a'):
> if [ $? == 1 ]
> possible bashism in ./usr/sbin/db2index line 62 (should be 'b = a'):
> if [ $? == 1 ]
> possible bashism in ./usr/sbin/db2bak line 60 (should be 'b = a'):
> if [ $? == 1 ]
> possible bashism in ./usr/sbin/upgradednformat line 58 (should be 'b = 
a'):
> if [ $? == 1 ]
> possible bashism in ./usr/sbin/upgradedb line 42 (should be 'b = a'):
> if [ $? == 1 ]
> possible bashism in ./usr/sbin/db2ldif line 140 (should be 'b = a'):
> if [ $? == 1 ]
> possible bashism in ./usr/sbin/monitor line 44 (should be 'b = a'):
> if [ $? == 1 ]
> possible bashism in ./usr/sbin/monitor line 69 (should be 'b = a'):
> if [ "$rootdn" == "" ]; then
> possible bashism in ./usr/sbin/monitor line 106 (should be 'b = a'):
> if [ "$security" == "on" ]; then
> possible bashism in ./usr/sbin/monitor line 107 (should be 'b = a'):
>     if [ "$protocol" == "STARTTLS" ] || [ "$protocol" == "" ]; then
> possible bashism in ./usr/sbin/monitor line 108 (should be 'b = a'):
>	  if [ "$error" == "yes" ]; then 
> possible bashism in ./usr/sbin/monitor line 111 (should be 'b = a'):
>	  if [ "$openldap" == "yes" ]; then
> possible bashism in ./usr/sbin/monitor line 123 (should be 'b = a'):
> if [ "$security" == "on" ]; then
> possible bashism in ./usr/sbin/monitor line 124 (should be 'b = a'):
>     if [ "$protocol" == "LDAPS" ] || [ "$protocol" == "" ]; then
> possible bashism in ./usr/sbin/monitor line 125 (should be 'b = a'):
>	  if [ "$error" == "yes" ]; then 
> possible bashism in ./usr/sbin/monitor line 128 (should be 'b = a'):
>	  if [ "$openldap" == "yes" ]; then
> possible bashism in ./usr/sbin/monitor line 140 (should be 'b = a'):
> if [ "$ldapi" == "on" ] && [ "$openldap" == "yes" ]; then
> possible bashism in ./usr/sbin/monitor line 141 (should be 'b = a'):
>     if [ "$protocol" == "LDAPI" ] || [ "$protocol" == "" ]; then
> possible bashism in ./usr/sbin/monitor line 142 (should be 'b = a'):
>	  if [ "$(id -u)" == "0" ] && [ "$autobind" == "on" ]; then
> possible bashism in ./usr/sbin/monitor line 143 (should be 'b = a'):
>	      if [ "$error" == "yes" ]; then 
> possible bashism in ./usr/sbin/monitor line 148 (should be 'b = a'):
>	      if [ "$error" == "yes" ]; then 
> possible bashism in ./usr/sbin/monitor line 160 (should be 'b = a'):
> if [ "$protocol" == "LDAP" ] || [ "$protocol" == "" ]; then
> possible bashism in ./usr/sbin/monitor line 161 (should be 'b = a'):
>     if [ "$error" == "yes" ]; then 
> possible bashism in ./usr/sbin/monitor line 164 (should be 'b = a'):
>     if [ "$openldap" == "yes" ]; then
> possible bashism in ./usr/sbin/start-dirsrv line 67 (should be 'b = a'):
>     if [ -d "/lib/systemd/system" ] && [ "$(id -u)" == "0" ];then
> possible bashism in ./etc/init.d/dirsrv line 121 (sleep only takes one
> integer):
>		  sleep 0.5


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



More information about the Pkg-fedora-ds-maintainers mailing list