[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 12:43:35 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
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:                     feedback
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:              
====================================================================== 
Date Submitted:             09-20-2007 14:14 CDT
Last Modified:              09-21-2007 12:43 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.
====================================================================== 

---------------------------------------------------------------------- 
 culrich - 09-21-07 12:43  
---------------------------------------------------------------------- 
Scripts which use bash features shouldn't be invoking /bin/sh, no matter
what the attitude of the Ubuntu developers.

The issue is fixed and it was not my intent to begin an argument about it,
so this will be my last note in this bug. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-21-07 12:43  culrich        Note Added: 0070925                          
======================================================================




More information about the asterisk-bugs mailing list