[asterisk-dev] [Code Review]: Patch to make app_system check if a command failed to execute due to permission denied.

Tilghman Lesher reviewboard at asterisk.org
Mon Jun 4 10:22:33 CDT 2012



> On June 4, 2012, 9:48 a.m., jrose wrote:
> > /trunk/apps/app_system.c, lines 134-138
> > <https://reviewboard.asterisk.org/r/1956/diff/1/?file=28436#file28436line134>
> >
> >     This looks mostly fine, but I'm having trouble finding any particular resource which definitively pegs this particular status from wait4 as indicating what is implied.  I don't know.
> >     
> >     Looking at the man page for wait4, I think reading specific values to evaluate success or failure might be the wrong way to go and instead perhaps the macros listed on the man page might be more proper.

Yes, but since ast_safe_system executes /bin/sh, he's not relying on wait4 returning a special status, but on the Bourne shell itself returning a special status.  It would appear that on his platform, /bin/sh is bash, which does have this behavior.  Unfortunately, it's not portable, because many systems do not have bash as /bin/sh, including many versions of Linux derived from Debian, where /bin/sh is dash.  On most commercial versions of Unix, including Solaris, for which we have traditionally have had some support, /bin/sh is also not bash.  So I think that this fails on portability.


- Tilghman


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1956/#review6375
-----------------------------------------------------------


On June 4, 2012, 9:23 a.m., Dennis Martinez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1956/
> -----------------------------------------------------------
> 
> (Updated June 4, 2012, 9:23 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> I created a patch that improves the app_system behavior.  The patch should make this application to check if a command failed to execute due to permission denied.
> 
> 
> This addresses bug ASTERISK-19935.
>     https://issues.asterisk.org/jira/browse/ASTERISK-19935
> 
> 
> Diffs
> -----
> 
>   /trunk/apps/app_system.c 368031 
> 
> Diff: https://reviewboard.asterisk.org/r/1956/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Dennis
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120604/d216a51d/attachment.htm>


More information about the asterisk-dev mailing list