summaryrefslogtreecommitdiffstats
path: root/action.cpp
diff options
context:
space:
mode:
authorHarald Welte2010-12-26 22:49:27 +0100
committerAndreas Eversberg2011-02-20 11:33:53 +0100
commit0eebd3a28e968844ec459298ac36e16305cc07bb (patch)
tree2856b304b77e2837a84c69a9964edd56f76bd4bb /action.cpp
parentGSM MNCC: Make sure to set the MNCC_F_KEYPAD when ACKing DTMF (diff)
downloadlcr-0eebd3a28e968844ec459298ac36e16305cc07bb.tar.gz
lcr-0eebd3a28e968844ec459298ac36e16305cc07bb.tar.xz
lcr-0eebd3a28e968844ec459298ac36e16305cc07bb.zip
don't execve() a shell process but always double-fork and then exec the program directly
Diffstat (limited to 'action.cpp')
-rw-r--r--action.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/action.cpp b/action.cpp
index b7dfc58..352efb4 100644
--- a/action.cpp
+++ b/action.cpp
@@ -1976,9 +1976,11 @@ void EndpointAppPBX::action_execute(void)
end_trace();
return;
}
+#if 0
argv[i++] = (char *)"/bin/sh";
argv[i++] = (char *)"-c";
argv[i++] = command;
+#endif
argv[i++] = command;
if ((rparam = routeparam(e_action, PARAM_PARAM))) {
argv[i++] = rparam->string_value;
@@ -1999,7 +2001,7 @@ void EndpointAppPBX::action_execute(void)
case 0:
/* To be shure there are no zombies created double fork */
if ((pid2 = fork()) == 0) {
- execve("/bin/sh", argv, environ);
+ execve(command, argv, environ);
}
else {
/* Exit immediately and release the waiting parent. The subprocess falls to init because the parent died */