No subject
Fri Sep 2 03:59:05 CDT 2011
le. Many channels would not ever need or care about a generic 'system =
call return value' variable, and I would hate to have it always around =
with a channel. Or worse, have it around when the system call returns, but=
not have it be present on a channel otherwise - those types of things are =
rarely documented well, and people would have to know when the variable exi=
sts and when it doesn't.
What's more, the system call may not even be 'channel specific'=
, that is, it may not change or affect the state of the channel. The scrip=
t could print out "Hello world!" - so associating its return valu=
e with a channel seems to imply a dependency that does not necessarily exis=
t.
Tilghman's suggestion of tying the return code of the script directly w=
ith the item that executed the script makes sense: we simply return the ret=
urn code of the thing that was executed.</pre>
</blockquote>
<p>On June 18th, 2012, 1:45 p.m., <b>jrose</b> wrote:</p>
<blockquote style=3D"margin-left: 1em; border-left: 2px solid #d0d0d0; pad=
ding-left: 10px;">
<pre style=3D"white-space: pre-wrap; white-space: -moz-pre-wrap; white-sp=
ace: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Ah, alrig=
ht then. Sorry for misinterpreting.
I'm just going to go ahead and mention that if another function for inv=
oking system commands is added (like func_system), manager will need to be =
updated to check manager users for SYSTEM write access where app_system and=
func_shell are currently checked. It'd be a fairly trivial change, but=
not doing it could lead to a security vulnerability.</pre>
</blockquote>
<p>On July 23rd, 2012, 4:15 p.m., <b>Kevin Fleming</b> wrote:</p>
<blockquote style=3D"margin-left: 1em; border-left: 2px solid #d0d0d0; pad=
ding-left: 10px;">
<pre style=3D"white-space: pre-wrap; white-space: -moz-pre-wrap; white-sp=
ace: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">So what w=
e have today is the SYSTEM() dialplan application that attempts to interpre=
t the result code it receives from the executed command (into the SYSTEMSTA=
TUS channel variable, which will either be SUCCESS or FAILURE), and the SHE=
LL() dialplan function, which collects the output generated by the executed=
command and returns it (but has no ability to return any status if the com=
mand execution failed for any reason).
Any suggestions on how to improve this situation? SHELL() uses popen() inte=
rnally, and it can return a result code from the command execution, but we&=
#39;d need to find a way to make that available to the dialplan.</pre>
</blockquote>
</blockquote>
<pre style=3D"white-space: pre-wrap; white-space: -moz-pre-wrap; white-spac=
e: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I addressed=
a similar situation with func_odbc, as functions created via that mechanis=
m regularly return multiple results, by allowing multiple values to be retr=
ieved from a function by using the ARRAY() assignment function. The HASH()=
dialplan function works in a similar way when assigning to it. So it woul=
d be possible for the return value of some dialplan function, whether that =
is SHELL2(), SYSTEM(), or something else (as long as it is a new function, =
to ensure backwards compatibility with existing functions) to return multip=
le values in this form. Is this a reasonable approach?</pre>
<br />
<p>- Tilghman</p>
<br />
<p>On June 4th, 2012, 9:23 a.m., Denis Martinez wrote:</p>
<table bgcolor=3D"#fefadf" width=3D"100%" cellspacing=3D"0" cellpadding=3D"=
8" style=3D"background-image: url('https://reviewboard.asterisk.org/media/r=
b/images/review_request_box_top_bg.png'); background-position: left top; ba=
ckground-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By Denis Martinez.</div>
<p style=3D"color: grey;"><i>Updated June 4, 2012, 9:23 a.m.</i></p>
<h1 style=3D"color: #575012; font-size: 10pt; margin-top: 1.5em;">Descripti=
on </h1>
<table width=3D"100%" bgcolor=3D"#ffffff" cellspacing=3D"0" cellpadding=3D"=
10" style=3D"border: 1px solid #b8b5a0">
<tr>
<td>
<pre style=3D"margin: 0; padding: 0; white-space: pre-wrap; white-space:=
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap=
: break-word;">I created a patch that improves the app_system behavior. Th=
e patch should make this application to check if a command failed to execut=
e due to permission denied.</pre>
</td>
</tr>
</table>
<div style=3D"margin-top: 1.5em;">
<b style=3D"color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href=3D"https://issues.asterisk.org/jira/browse/ASTERISK-19935">ASTERIS=
K-19935</a>
</div>
<h1 style=3D"color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b>=
</h1>
<ul style=3D"margin-left: 3em; padding-left: 0;">
<li>/trunk/apps/app_system.c <span style=3D"color: grey">(368031)</span></=
li>
</ul>
<p><a href=3D"https://reviewboard.asterisk.org/r/1956/diff/" style=3D"margi=
n-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
--===============6847331975803453454==--
More information about the asterisk-dev
mailing list