Commit d5f521ac authored by Christophe Jaillet's avatar Christophe Jaillet
Browse files

When processing a 'SetEnv' directive, warn if the environment variable name...

When processing a 'SetEnv' directive, warn if the environment variable name includes a '='. It is likely a configuration error.   PR 60249

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1795635 13f79535-47bb-0310-9956-ffa450edef68
parent 42e26120
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
                                                         -*- coding: utf-8 -*-
Changes with Apache 2.5.0

  *) mod_env: when processing a 'SetEnv' directive, warn if the environment
     variable name includes a '='. It is likely a configuration error.
     PR 60249 [Christophe Jaillet]

  *) Evaluate nested If/ElseIf/Else configuration blocks.
     [Luca Toscano, Jacob Champion]

+1 −1
Original line number Diff line number Diff line
10032
10033
+11 −0
Original line number Diff line number Diff line
@@ -113,6 +113,17 @@ static const char *add_env_module_vars_set(cmd_parms *cmd, void *sconf_,
{
    env_dir_config_rec *sconf = sconf_;

    if (ap_strchr_c(name, '=')) {
        char *env, *plast;

        env = apr_strtok(apr_pstrdup(cmd->temp_pool, name), "=", &plast);

        ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server, APLOGNO(10032)
                     "Spurious usage of '=' in an environment variable name. "
                     "'%s %s %s' expected instead?", cmd->cmd->name, env, plast);
    
    }

    /* name is mandatory, value is optional.  no value means
     * set the variable to an empty string
     */