httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@hyperreal.org
Subject cvs commit: apache-1.3/src/modules/standard mod_env.c
Date Sat, 10 Apr 1999 21:51:07 GMT
ben         99/04/10 14:51:06

  Modified:    src      CHANGES
               src/modules/standard mod_env.c
  Log:
  Make env directives per-directory instead of per-server.
  
  Revision  Changes    Path
  1.1306    +3 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1305
  retrieving revision 1.1306
  diff -u -r1.1305 -r1.1306
  --- CHANGES	1999/04/10 15:08:43	1.1305
  +++ CHANGES	1999/04/10 21:51:01	1.1306
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.7
   
  +  *) Make {Set,Unset,Pass}Env per-directory instead of per-server.
  +     [Ben Laurie]
  +
     *) Correct an apparent typo: on the Windows and MPE platforms, the
        htpasswd utility was limiting passwords to only 8 characters.
        [Ken Coar]
  
  
  
  1.29      +23 -27    apache-1.3/src/modules/standard/mod_env.c
  
  Index: mod_env.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_env.c,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- mod_env.c	1999/03/22 23:38:21	1.28
  +++ mod_env.c	1999/04/10 21:51:06	1.29
  @@ -105,26 +105,26 @@
       table *vars;
       char *unsetenv;
       int vars_present;
  -} env_server_config_rec;
  +} env_dir_config_rec;
   
   module MODULE_VAR_EXPORT env_module;
   
  -static void *create_env_server_config(pool *p, server_rec *dummy)
  +static void *create_env_dir_config(pool *p, char *dummy)
   {
  -    env_server_config_rec *new =
  -    (env_server_config_rec *) ap_palloc(p, sizeof(env_server_config_rec));
  +    env_dir_config_rec *new =
  +    (env_dir_config_rec *) ap_palloc(p, sizeof(env_dir_config_rec));
       new->vars = ap_make_table(p, 50);
       new->unsetenv = "";
       new->vars_present = 0;
       return (void *) new;
   }
   
  -static void *merge_env_server_configs(pool *p, void *basev, void *addv)
  +static void *merge_env_dir_configs(pool *p, void *basev, void *addv)
   {
  -    env_server_config_rec *base = (env_server_config_rec *) basev;
  -    env_server_config_rec *add = (env_server_config_rec *) addv;
  -    env_server_config_rec *new =
  -    (env_server_config_rec *) ap_palloc(p, sizeof(env_server_config_rec));
  +    env_dir_config_rec *base = (env_dir_config_rec *) basev;
  +    env_dir_config_rec *add = (env_dir_config_rec *) addv;
  +    env_dir_config_rec *new =
  +    (env_dir_config_rec *) ap_palloc(p, sizeof(env_dir_config_rec));
   
       table *new_table;
       table_entry *elts;
  @@ -166,11 +166,10 @@
       return new;
   }
   
  -static const char *add_env_module_vars_passed(cmd_parms *cmd, char *struct_ptr,
  +static const char *add_env_module_vars_passed(cmd_parms *cmd,
  +					      env_dir_config_rec *sconf,
                                                 const char *arg)
   {
  -    env_server_config_rec *sconf =
  -    ap_get_module_config(cmd->server->module_config, &env_module);
       table *vars = sconf->vars;
       char *env_var;
       char *name_ptr;
  @@ -186,11 +185,10 @@
       return NULL;
   }
   
  -static const char *add_env_module_vars_set(cmd_parms *cmd, char *struct_ptr,
  +static const char *add_env_module_vars_set(cmd_parms *cmd,
  +					   env_dir_config_rec *sconf,
                                              const char *arg)
   {
  -    env_server_config_rec *sconf =
  -    ap_get_module_config(cmd->server->module_config, &env_module);
       table *vars = sconf->vars;
       char *name, *value;
   
  @@ -212,11 +210,10 @@
       return NULL;
   }
   
  -static const char *add_env_module_vars_unset(cmd_parms *cmd, char *struct_ptr,
  +static const char *add_env_module_vars_unset(cmd_parms *cmd,
  +					     env_dir_config_rec *sconf,
                                                char *arg)
   {
  -    env_server_config_rec *sconf =
  -    ap_get_module_config(cmd->server->module_config, &env_module);
       sconf->unsetenv = sconf->unsetenv ?
           ap_pstrcat(cmd->pool, sconf->unsetenv, " ", arg, NULL) :
            arg;
  @@ -226,19 +223,18 @@
   static const command_rec env_module_cmds[] =
   {
       {"PassEnv", add_env_module_vars_passed, NULL,
  -     RSRC_CONF, RAW_ARGS, "a list of environment variables to pass to CGI."},
  +     OR_FILEINFO, RAW_ARGS, "a list of environment variables to pass to CGI."},
       {"SetEnv", add_env_module_vars_set, NULL,
  -     RSRC_CONF, RAW_ARGS, "an environment variable name and a value to pass to CGI."},
  +     OR_FILEINFO, RAW_ARGS, "an environment variable name and a value to pass to CGI."},
       {"UnsetEnv", add_env_module_vars_unset, NULL,
  -     RSRC_CONF, RAW_ARGS, "a list of variables to remove from the CGI environment."},
  +     OR_FILEINFO, RAW_ARGS, "a list of variables to remove from the CGI environment."},
       {NULL},
   };
   
   static int fixup_env_module(request_rec *r)
   {
       table *e = r->subprocess_env;
  -    server_rec *s = r->server;
  -    env_server_config_rec *sconf = ap_get_module_config(s->module_config,
  +    env_dir_config_rec *sconf = ap_get_module_config(r->per_dir_config,
                                                        &env_module);
       table *vars = sconf->vars;
   
  @@ -254,10 +250,10 @@
   {
       STANDARD_MODULE_STUFF,
       NULL,                       /* initializer */
  -    NULL,                       /* dir config creater */
  -    NULL,                       /* dir merger --- default is to override */
  -    create_env_server_config,   /* server config */
  -    merge_env_server_configs,   /* merge server configs */
  +    create_env_dir_config,      /* dir config creater */
  +    merge_env_dir_configs,      /* dir merger --- default is to override */
  +    NULL,                       /* server config */
  +    NULL,                       /* merge server configs */
       env_module_cmds,            /* command table */
       NULL,                       /* handlers */
       NULL,                       /* filename translation */
  
  
  

Mime
View raw message