aboutsummaryrefslogtreecommitdiffstats
path: root/funcs
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-28 22:50:06 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-28 22:50:06 +0000
commit5696c8402789c5f835bc4428c3bea8204cf01352 (patch)
treee02a13ebfaee0233cb41293d7da871d1af74e5d5 /funcs
parent1297a5987850c9af9eef4179d6c4ae7a467bd49a (diff)
Setup environment variables for the benefit of child processes and disallow changing them.
(closes issue #14899) Reported by: jmls Patches: 20090916__issue14899.diff.txt uploaded by tilghman (license 14) Tested by: jmls git-svn-id: http://svn.digium.com/svn/asterisk/trunk@266385 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs')
-rw-r--r--funcs/func_env.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/funcs/func_env.c b/funcs/func_env.c
index 70a87776b..b770bbc9b 100644
--- a/funcs/func_env.c
+++ b/funcs/func_env.c
@@ -44,6 +44,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
</parameter>
</syntax>
<description>
+ Variables starting with <literal>AST_</literal> are reserved to the system and may not be set.
</description>
</function>
<function name="STAT" language="en_US">
@@ -106,7 +107,7 @@ static int env_read(struct ast_channel *chan, const char *cmd, char *data,
static int env_write(struct ast_channel *chan, const char *cmd, char *data,
const char *value)
{
- if (!ast_strlen_zero(data)) {
+ if (!ast_strlen_zero(data) && strncmp(data, "AST_", 4)) {
if (!ast_strlen_zero(value)) {
setenv(data, value, 1);
} else {