summaryrefslogtreecommitdiff
path: root/funcs
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2010-05-28 22:50:06 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2010-05-28 22:50:06 +0000
commit2da88f1977295c7945a2cd3a5c6a79246439ccd0 (patch)
treee02a13ebfaee0233cb41293d7da871d1af74e5d5 /funcs
parent7e204048fc143235751a6546187d7ca25792a1f0 (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: https://origsvn.digium.com/svn/asterisk/trunk@266385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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 {