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
This commit is contained in:
Tilghman Lesher
2010-05-28 22:50:06 +00:00
parent 7e204048fc
commit 2da88f1977
3 changed files with 18 additions and 1 deletions

View File

@@ -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 {