[Debian-ha-maintainers] Bug#690928: resource-agents: bashism in /bin/sh script

Raphael Geissert atomo64 at gmail.com
Fri Oct 19 06:14:49 UTC 2012


Package: resource-agents
Version: 1:3.9.3+git20121009-1
Severity: important
User: debian-release at lists.debian.org
Usertags: goal-dash

Hello maintainer,

While performing an archive wide checkbashisms (from the 'devscripts' 
package) check I've found your package containing a /bin/sh script making 
use of a bashism.

checkbashisms' output:
>possible bashism in ./usr/lib/ocf/resource.d/heartbeat/Xinetd line 100 
(typeset):
>    typeset result=$(sed -nre 's/^[     ]*disable[      ]*=[    ]*([^  
>    ]+)[#   ]*/\1/p' $1)
>possible bashism in ./usr/lib/ocf/resource.d/heartbeat/Xinetd line 117 
(typeset):
>    typeset disabled="$(check_service $SVCDEF)"
>possible bashism in ./usr/lib/ocf/resource.d/heartbeat/exportfs line 275 
(let ...):
>                let i=$i+1
>possible bashism in ./usr/lib/ocf/resource.d/heartbeat/dhcpd line 313 
(alternative test command ([[ foo ]] should be [ foo ])):
>                [[ $c =~ $ldd_wl ]] || continue
>possible bashism in ./usr/lib/ocf/resource.d/heartbeat/dhcpd line 314 
(alternative test command ([[ foo ]] should be [ foo ])):
>                [[ $c =~ $ldd_bl ]] && continue
>possible bashism in ./usr/lib/ocf/resource.d/heartbeat/tomcat line 474 
(alternative test command ([[ foo ]] should be [ foo ])):
>        if [[ "$RESOURCE_STATUSURL" =~ :[0-9][0-9]* ]]; then

Not using bash (or a Debian Policy conformant shell interpreter which 
doesn't provide such an extra feature) as /bin/sh is likely to lead to 
errors or unexpected behaviours.

You can find hints about how to fix bashisms at:
https://wiki.ubuntu.com/DashAsBinSh

Thank you,
Raphael Geissert



More information about the Debian-ha-maintainers mailing list