[asterisk-bugs] [Asterisk 0010772]: safe_asterisk incorrectly invokes /bin/sh instead of /bin/bash
noreply at bugs.digium.com
noreply at bugs.digium.com
Fri Sep 21 13:06:26 CDT 2007
The following issue has been RESOLVED.
======================================================================
http://bugs.digium.com/view.php?id=10772
======================================================================
Reported By: culrich
Assigned To: russell
======================================================================
Project: Asterisk
Issue ID: 10772
Category: Core-General
Reproducibility: always
Severity: major
Priority: normal
Status: resolved
Asterisk Version: 1.4.11
SVN Branch (only for SVN checkouts, not tarball releases): N/A
SVN Revision (number only!): 81744
Disclaimer on File?: N/A
Request Review:
Resolution: fixed
Fixed in Version:
======================================================================
Date Submitted: 09-20-2007 14:14 CDT
Last Modified: 09-21-2007 13:06 CDT
======================================================================
Summary: safe_asterisk incorrectly invokes /bin/sh instead of
/bin/bash
Description:
The /contrib/script/safe_asterisk script invocation line refers to /bin/sh.
/bin/sh should only be invoked for a script that is compatible with the
original Bourne shell, which safe_asterisk is not. It contains shell
language constructs that are valid only in the Bourne Again shell, which is
commonly invoked as /bin/bash.
On most Linux distributions, this is a not a problem since /bin/sh is
usually a symbolic link to /bin/bash. On other systems like FreeBSD and
Ubuntu, /bin/sh is an actual Bourne shell, not /bin/bash. This script fails
on these systems and because shell scripts are notoriously bad at error
reporting, the error message on failure is not helpful at determining the
cause of the failure.
The proper fix to this is to either change the shell invocation line to
invoke /bin/bash or modify the script to conform to Bourne shell syntax.
There may be other shell scripts in the Asterisk distribution with this
issue, but safe_asterisk is the only one that I have noticed thus far.
======================================================================
----------------------------------------------------------------------
russell - 09-21-07 13:06
----------------------------------------------------------------------
Agreed - it is certainly a bug on our part to invoke /bin/sh with a script
that actually requires bash. Thanks for pointing it out.
Issue History
Date Modified Username Field Change
======================================================================
09-21-07 13:06 russell Status feedback => resolved
09-21-07 13:06 russell Resolution reopened => fixed
09-21-07 13:06 russell Note Added: 0070926
======================================================================
More information about the asterisk-bugs
mailing list