Debian Bug report logs - #476761
mwavem: bashism in /bin/sh script

version graph

Package: mwavem; Maintainer for mwavem is (unknown);

Reported by: Raphael Geissert <atomo64@gmail.com>

Date: Fri, 18 Apr 2008 23:03:07 UTC

Severity: important

Tags: confirmed

Found in version mwavem/2.0-2

Fixed in version mwavem/2.0-3

Done: Thomas Hood <jdthood@yahoo.co.uk>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to Debian mwavem maintainers <pkg-mwavem-devel@lists.alioth.debian.org>:
Bug#476761; Package mwavem. (full text, mbox, link).


Message #3 received at maintonly@bugs.debian.org (full text, mbox, reply):

From: Raphael Geissert <atomo64@gmail.com>
To: maintonly@bugs.debian.org
Subject: mwavem: bashism in /bin/sh script
Date: Fri, 18 Apr 2008 18:00:31 -0500
Package: mwavem
Severity: important
Version: 2.0-2
User: debian-release@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 several /bin/sh scripts making 
use of a bashism.

checkbashisms' output:
> possible bashism in ./usr/sbin/mwavemd line 104 (bash arrays,
> ${name[0|*|@]}):
> exitstatus=${PIPESTATUS[1]} 
> possible bashism in ./etc/init.d/mwavem line 206 (kill -[0-9] or -[A-Z]):
>                                 kill -9 "$(pidof $DAEMONPATHNAME)"
> >/dev/null 2>&1 possible bashism in ./etc/init.d/mwavem line 218 (kill
> -[0-9] or -[A-Z]):
> kill -9 "$(pidof $MWAVEMANAGERPATHNAME)" >/dev/null 2>&1 
>  # Just to make sure

Not using bash (or a Debian Policy conformant shell interpreter which does 
provide such an extra feature) as /bin/sh is likely to lead to errors or 
unexpected behaviours.
Please be aware that although bash is currently the default /bin/sh there's a 
release goal for Lenny to make dash the default /bin/sh[1].

If you want more information about dash as /bin/sh, you can read:
http://lists.debian.org/debian-release/2008/01/msg00189.html

For more information please refer to the Debian Policy section 10.4 supporting 
this argument at:
http://www.debian.org/doc/debian-policy/ch-files.html#s-scripts

Hints about how to fix bashisms:
Sometimes these bugs are already fixed in Ubuntu, look at the PTS.
If not already fixed you can read:
https://wiki.ubuntu.com/DashAsBinSh

[1]http://release.debian.org/lenny/goals.txt

Thank you,
-- 
Atomo64 - Raphael

Please avoid sending me Word, PowerPoint or Excel attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html




Information forwarded to Debian mwavem maintainers <pkg-mwavem-devel@lists.alioth.debian.org>:
Bug#476761; Package mwavem. (full text, mbox, link).


Acknowledgement sent to tony mancill <tmancill@debian.org>:
Extra info received and forwarded to maintainer. Copy sent to Debian mwavem maintainers <pkg-mwavem-devel@lists.alioth.debian.org>. (full text, mbox, link).


Message #8 received at 476761-maintonly@bugs.debian.org (full text, mbox, reply):

From: tony mancill <tmancill@debian.org>
To: Raphael Geissert <atomo64@gmail.com>, 476761-maintonly@bugs.debian.org
Subject: Re: [Pkg-mwavem-devel] Bug#476761: mwavem: bashism in /bin/sh script
Date: Sun, 20 Apr 2008 21:33:45 -0700
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Raphael,

Thank you for the bug report.  I see that PIPESTATUS[] is definitely a
bashism, but I am confused as to why checkbashism reports "kill -9" as a
possible bashism.  Is it because kill is a built-in for bash, but not for
dash (and the procps executable is used instead)?

Thanks,
Tony

Raphael Geissert wrote:
> Package: mwavem
> Severity: important
> Version: 2.0-2
> User: debian-release@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 several /bin/sh scripts making 
> use of a bashism.
> 
> checkbashisms' output:
>> possible bashism in ./usr/sbin/mwavemd line 104 (bash arrays,
>> ${name[0|*|@]}):
>> exitstatus=${PIPESTATUS[1]} 
>> possible bashism in ./etc/init.d/mwavem line 206 (kill -[0-9] or -[A-Z]):
>>                                 kill -9 "$(pidof $DAEMONPATHNAME)"
>>> /dev/null 2>&1 possible bashism in ./etc/init.d/mwavem line 218 (kill
>> -[0-9] or -[A-Z]):
>> kill -9 "$(pidof $MWAVEMANAGERPATHNAME)" >/dev/null 2>&1 
>>  # Just to make sure
> 
> Not using bash (or a Debian Policy conformant shell interpreter which does 
> provide such an extra feature) as /bin/sh is likely to lead to errors or 
> unexpected behaviours.
> Please be aware that although bash is currently the default /bin/sh there's a 
> release goal for Lenny to make dash the default /bin/sh[1].
> 
> If you want more information about dash as /bin/sh, you can read:
> http://lists.debian.org/debian-release/2008/01/msg00189.html
> 
> For more information please refer to the Debian Policy section 10.4 supporting 
> this argument at:
> http://www.debian.org/doc/debian-policy/ch-files.html#s-scripts
> 
> Hints about how to fix bashisms:
> Sometimes these bugs are already fixed in Ubuntu, look at the PTS.
> If not already fixed you can read:
> https://wiki.ubuntu.com/DashAsBinSh
> 
> [1]http://release.debian.org/lenny/goals.txt
> 
> Thank you,

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIDBkppdwBkPlyvgMRAorRAJsFmwUCAs43aCTBFOomAQ0RoZxTowCfR7ls
PXsZ2ZXa7r0vUMsjsgceKt8=
=3Mxg
-----END PGP SIGNATURE-----




Message sent on to Raphael Geissert <atomo64@gmail.com>:
Bug#476761. (full text, mbox, link).


Message #11 received at 476761-submitter@bugs.debian.org (full text, mbox, reply):

From: Thomas Hood <jdthood@gmail.com>
To: 476761-submitter@bugs.debian.org
Cc: tony mancill <tmancill@debian.org>
Subject: Re: [Pkg-mwavem-devel] Bug#476761: Bug#476761: mwavem: bashism in /bin/sh script
Date: Mon, 21 Apr 2008 15:23:07 +0200
Tony: I have changed the shebang in mwavemd.  While I was at it
I added LSB headers to the initscript.  Can you please do a release?


(There is one lintian warning on the package:
     W: mwavem: read-in-maintainer-script postinst:13
but it's bogus.)


> I am confused as to why checkbashism reports "kill -9" as a
> possible bashism.


Yes: I don't see how the line in question is contrary to policy.

    kill -9 "$(pidof $MWAVEMANAGERPATHNAME)" >/dev/null 2>&1
-- 
Thomas





Information forwarded to Debian mwavem maintainers <pkg-mwavem-devel@lists.alioth.debian.org>:
Bug#476761; Package mwavem. (full text, mbox, link).


Acknowledgement sent to "Raphael Geissert" <atomo64@gmail.com>:
Extra info received and forwarded to maintainer. Copy sent to Debian mwavem maintainers <pkg-mwavem-devel@lists.alioth.debian.org>. (full text, mbox, link).


Message #16 received at 476761-maintonly@bugs.debian.org (full text, mbox, reply):

From: "Raphael Geissert" <atomo64@gmail.com>
To: "tony mancill" <tmancill@debian.org>
Cc: 476761-maintonly@bugs.debian.org
Subject: Re: [Pkg-mwavem-devel] Bug#476761: mwavem: bashism in /bin/sh script
Date: Mon, 21 Apr 2008 15:24:27 -0500
Hello Tony,

On 20/04/2008, tony mancill <tmancill@debian.org> wrote:
>
>  Hello Raphael,
>
>  Thank you for the bug report.  I see that PIPESTATUS[] is definitely a
>  bashism, but I am confused as to why checkbashism reports "kill -9" as a
>  possible bashism.  Is it because kill is a built-in for bash, but not for
>  dash (and the procps executable is used instead)?

No, it is because according to the specs it should be kill -s 9;
though both bash and dash (and other common POSIX shell scripts
interpreters) do allow kill -9.

>
>  Thanks,
>  Tony
>

Cheers,
-- 
Atomo64 - Raphael

Please avoid sending me Word, PowerPoint or Excel attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html




Message sent on to Raphael Geissert <atomo64@gmail.com>:
Bug#476761. (full text, mbox, link).


Message #19 received at 476761-submitter@bugs.debian.org (full text, mbox, reply):

From: Thomas Hood <jdthood@gmail.com>
To: 476761-submitter@bugs.debian.org
Cc: tony mancill <tmancill@debian.org>
Subject: Re: [Pkg-mwavem-devel] Bug#476761: Bug#476761: mwavem: bashism in /bin/sh script
Date: Mon, 21 Apr 2008 23:55:46 +0200
On Mon, 2008-04-21 at 15:24 -0500, Raphael Geissert wrote:
> No, it is because according to the specs it should be kill -s 9;
> though both bash and dash (and other common POSIX shell scripts
> interpreters) do allow kill -9.


/bin/kill also supports kill -9.  

http://www.opengroup.org/onlinepubs/000095399/utilities/kill.html says
that kill -9 is an XSI extension.

> Functionality marked XSI is also an extension to the ISO C standard.
> Application writers may confidently make use of an extension on all
> systems supporting the X/Open System Interfaces Extension.


What is the status of XSI extensions in Debian policy?
-- 
Thomas





Information forwarded to debian-bugs-dist@lists.debian.org, Debian mwavem maintainers <pkg-mwavem-devel@lists.alioth.debian.org>:
Bug#476761; Package mwavem. (full text, mbox, link).


Acknowledgement sent to "Raphael Geissert" <atomo64@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian mwavem maintainers <pkg-mwavem-devel@lists.alioth.debian.org>. (full text, mbox, link).


Message #24 received at 476761@bugs.debian.org (full text, mbox, reply):

From: "Raphael Geissert" <atomo64@gmail.com>
To: 476761@bugs.debian.org
Cc: "tony mancill" <tmancill@debian.org>
Subject: Re: Bug#476761: [Pkg-mwavem-devel] Bug#476761: Bug#476761: mwavem: bashism in /bin/sh script
Date: Mon, 21 Apr 2008 19:02:23 -0500
On 21/04/2008, Thomas Hood <jdthood@gmail.com> wrote:
> On Mon, 2008-04-21 at 15:24 -0500, Raphael Geissert wrote:
>  > No, it is because according to the specs it should be kill -s 9;
>  > though both bash and dash (and other common POSIX shell scripts
>  > interpreters) do allow kill -9.
>
>
>  /bin/kill also supports kill -9.
>
>  http://www.opengroup.org/onlinepubs/000095399/utilities/kill.html says
>  that kill -9 is an XSI extension.
>
>  > Functionality marked XSI is also an extension to the ISO C standard.
>  > Application writers may confidently make use of an extension on all
>  > systems supporting the X/Open System Interfaces Extension.
>
>
>  What is the status of XSI extensions in Debian policy?

As you can guess: XSI extensions are _not_ required by policy.

You may also want to refer to #436438, and #477240

>  --
>
> Thomas
>
>
>
>

Cheers,
-- 
Atomo64 - Raphael

Please avoid sending me Word, PowerPoint or Excel attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html




Tags added: confirmed, pending Request was from Thomas Hood <jdthood@gmail.com> to control@bugs.debian.org. (Tue, 22 Apr 2008 08:39:18 GMT) (full text, mbox, link).


Message sent on to Raphael Geissert <atomo64@gmail.com>:
Bug#476761. (full text, mbox, link).


Message #29 received at 476761-submitter@bugs.debian.org (full text, mbox, reply):

From: Thomas Hood <jdthood@gmail.com>
To: 476761-submitter@bugs.debian.org
Cc: tony mancill <tmancill@debian.org>
Subject: Re: [Pkg-mwavem-devel] Bug#476761: Bug#476761: Bug#476761: mwavem: bashism in /bin/sh script
Date: Tue, 22 Apr 2008 10:28:01 +0200
tags 476761 confirmed pending
stop

On Mon, 2008-04-21 at 19:02 -0500, Raphael Geissert wrote:
> On 21/04/2008, Thomas Hood <jdthood@gmail.com> wrote:
> > On Mon, 2008-04-21 at 15:24 -0500, Raphael Geissert wrote:
> >  > No, it is because according to the specs it should be kill -s 9;
> >  > though both bash and dash (and other common POSIX shell scripts
> >  > interpreters) do allow kill -9.


Even "kill -s 9" is too much for posh.  It only allows "kill -s KILL".

$ posh
$ sleep 1000 &
[1] 8620
$ ps
  PID TTY          TIME CMD
 6245 pts/1    00:00:00 bash
 8619 pts/1    00:00:00 posh
 8620 pts/1    00:00:00 sleep
 8622 pts/1    00:00:00 ps
$ kill -s 9 8620
posh: kill: bad signal `9'
$ kill -s KILL 8620
$ ps
  PID TTY          TIME CMD
 6245 pts/1    00:00:00 bash
 8619 pts/1    00:00:00 posh
 8620 pts/1    00:00:00 sleep <defunct>
 8623 pts/1    00:00:00 ps
$ ps
  PID TTY          TIME CMD
 6245 pts/1    00:00:00 bash
 8619 pts/1    00:00:00 posh
 8624 pts/1    00:00:00 ps

(N.B. This was done under Ubuntu Hardy.)


> >  http://www.opengroup.org/onlinepubs/000095399/utilities/kill.html says
> >  that kill -9 is an XSI extension.
> >
> >  What is the status of XSI extensions in Debian policy?
> 
> As you can guess: XSI extensions are _not_ required by policy.
> 
> You may also want to refer to #436438, and #477240


OK, I have fixed it in svn.

Tony: 2.0-3 should be releasable now.
-- 
Thomas





Reply sent to Thomas Hood <jdthood@yahoo.co.uk>:
You have taken responsibility. (full text, mbox, link).


Notification sent to Raphael Geissert <atomo64@gmail.com>:
Bug acknowledged by developer. (full text, mbox, link).


Message #34 received at 476761-close@bugs.debian.org (full text, mbox, reply):

From: Thomas Hood <jdthood@yahoo.co.uk>
To: 476761-close@bugs.debian.org
Subject: Bug#476761: fixed in mwavem 2.0-3
Date: Tue, 22 Apr 2008 14:32:03 +0000
Source: mwavem
Source-Version: 2.0-3

We believe that the bug you reported is fixed in the latest version of
mwavem, which is due to be installed in the Debian FTP archive:

mwavem_2.0-3.diff.gz
  to pool/non-free/m/mwavem/mwavem_2.0-3.diff.gz
mwavem_2.0-3.dsc
  to pool/non-free/m/mwavem/mwavem_2.0-3.dsc
mwavem_2.0-3_i386.deb
  to pool/non-free/m/mwavem/mwavem_2.0-3_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 476761@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Thomas Hood <jdthood@yahoo.co.uk> (supplier of updated mwavem package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 21 Apr 2008 13:48:14 +0200
Source: mwavem
Binary: mwavem
Architecture: source i386
Version: 2.0-3
Distribution: unstable
Urgency: low
Maintainer: Debian mwavem maintainers <pkg-mwavem-devel@lists.alioth.debian.org>
Changed-By: Thomas Hood <jdthood@yahoo.co.uk>
Description: 
 mwavem     - Mwave/ACP modem support software
Closes: 476761
Changes: 
 mwavem (2.0-3) unstable; urgency=low
 .
   * Deal with bashisms in sh scripts:
     * Switch to #!/bin/bash in /usr/sbin/mwavemd
     * s/kill -9/kill -s KILL/ in /etc/init.d/mwavem
     Thanks to Raphael Geissert for pointing out the problems.
     (Closes: #476761)
   * Add LSB headers to initscript
Checksums-Sha1: 
 d89e5c2c84037dd77c22326c75f1e33f03668021 1046 mwavem_2.0-3.dsc
 58c723db2b3fbc91c5c7c6b690e667046d032c17 16962 mwavem_2.0-3.diff.gz
 603b63ae9085fe044ae7f34c93d5b4d30a204b57 930182 mwavem_2.0-3_i386.deb
Checksums-Sha256: 
 6d4174405c33bc8845ec7bf2fd38c525d6e0eacebd47fe482ab9477ef78445de 1046 mwavem_2.0-3.dsc
 3865a5b1efa70c91d23a387f0848265fb58e1e12e411b40b80216576afec88d7 16962 mwavem_2.0-3.diff.gz
 b7cc0e86e55350f86a6037cdf449bd603616b9a68cf191cd8499882f00391d12 930182 mwavem_2.0-3_i386.deb
Files: 
 b8ab6d5f9534ac37cbb0798909bddd2b 1046 non-free/utils extra mwavem_2.0-3.dsc
 63b7387e35d84a3b547b307d614e6d8f 16962 non-free/utils extra mwavem_2.0-3.diff.gz
 fba9e9177bab5fa246e98598f8037c8c 930182 non-free/utils extra mwavem_2.0-3_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIDfIupdwBkPlyvgMRAqo4AJ9ZX6vmxyFrIP7ecD6LV8VgHlG3hQCfUVqv
pKBHmjjzpYJ5Esp1S+j6BnA=
=lQ88
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 01 Jun 2008 07:34:10 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Jul 2 08:15:55 2023; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.