Bug 718336

Summary: initscript causes asterisk to run as root
Product: [Fedora] Fedora Reporter: Anthony Messina <amessina>
Component: asteriskAssignee: Jeffrey C. Ollie <jeff>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: itamar, jeff, tom
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-20 13:54:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Anthony Messina 2011-07-01 20:46:45 UTC
The initscript patch replaces replaces ASTARGS with AST_ARGS (underscore) in the AST_USER and AST_GROUP lines, but does not include AST_ARGS in the lines stat start the daemon, leaving asterisk to run as root.  The 0001-Modify-init-scripts-for-better-Fedora-compatibilty.patch, if modified to change AST_ARGS to ASTARGS works well with asterisk running as the user and group asterisk.

 103         if [ $AST_USER ] ; then
 104 -               ASTARGS="-U $AST_USER"
 105 +               AST_ARGS="$AST_ARGS -U $AST_USER"
 106         fi
 107         if [ $AST_GROUP ] ; then
 108 -               ASTARGS="$ASTARGS -G $AST_GROUP"
 109 +               AST_ARGS="$AST_ARGS -G $AST_GROUP"
 110         fi
 111         if [ $AST_CONFIG ]; then
 112 -               ASTARGS="$ASTARGS -C $AST_CONFIG/asterisk.conf"
 113 +               ASTARGS="$ASTARGS -C $AST_CONFIG"
 114         elif [ $ALTCONF ]; then
 115                 ASTARGS="$ASTARGS -C $ALTCONF"
 116         fi
 117 @@ -115,9 +127,9 @@ start() {
 118         fi
 119         if [ "x$COLOR" = "xyes" ]; then
 120                 export TERM=linux
 121 -               daemon sh -c "$DAEMON $ASTARGS -c" >/dev/null </dev/null 2>&1 &
 122 +               daemon sh -c "$DAEMON $ASTARGS $AST_EXTRA_ARGS -c" >/dev/null </dev/null 2>&1 &
 123         else
 124 -               daemon $DAEMON $ASTARGS
 125 +               daemon $DAEMON $ASTARGS $AST_EXTRA_ARGS

Comment 1 Tom Hughes 2011-08-22 08:09:08 UTC
This really needs to be fixed - this bug means that many people are probably unwittingly running asterisk as root with all the greater risks which that entails.

Comment 2 Jeffrey C. Ollie 2011-09-20 13:54:44 UTC

*** This bug has been marked as a duplicate of bug 666081 ***