[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 09:17:00 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 09:17 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.
====================================================================== 

---------------------------------------------------------------------- 
 Corydon76 - 09-21-07 09:17  
---------------------------------------------------------------------- 
The Ubuntu developers' rationale came down to "we don't care if we break
10,000 packages, because we're right, and everybody else is wrong".  Not
exactly a very user-friendly attitude, but it is what it is. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-21-07 09:17  Corydon76      Note Added: 0070918                          
======================================================================




More information about the asterisk-bugs mailing list