lars 99/03/22 15:38:26
Modified: htdocs/manual/mod mod_env.html src/modules/standard mod_env.c src CHANGES . Announcement Log: Back out Ken's PassAllEnv code... Revision Changes Path 1.14 +0 -47 apache-1.3/htdocs/manual/mod/mod_env.html Index: mod_env.html =================================================================== RCS file: /export/home/cvs/apache-1.3/htdocs/manual/mod/mod_env.html,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- mod_env.html 1999/03/20 21:51:37 1.13 +++ mod_env.html 1999/03/22 23:38:20 1.14 @@ -30,58 +30,11 @@ <H2>Directives</H2> <UL> -<LI><A HREF="#passallenv">PassAllEnv</A> <LI><A HREF="#passenv">PassEnv</A> <LI><A HREF="#setenv">SetEnv</A> <LI><A HREF="#unsetenv">UnsetEnv</A> </UL> -<HR> - -<H2><A NAME="passallenv">PassAllEnv</A></H2> -<A - HREF="directive-dict.html#Syntax" - REL="Help" -><STRONG>Syntax:</STRONG></A> PassAllEnv <EM>On | Off</EM><BR> -<A - HREF="directive-dict.html#Default" - REL="Help" -><STRONG>Default:</STRONG></A> <EM>Off</EM> -<BR> -<A - HREF="directive-dict.html#Context" - REL="Help" -><STRONG>Context:</STRONG></A> directory<BR> -<A - HREF="directive-dict.html#Status" - REL="Help" -><STRONG>Status:</STRONG></A> Base<BR> -<A - HREF="directive-dict.html#Module" - REL="Help" -><STRONG>Module:</STRONG></A> mod_env<BR> -<A - HREF="directive-dict.html#Compatibility" - REL="Help" -><STRONG>Compatibility:</STRONG></A> PassAllEnv is only available in -Apache 1.3.5 and later. -<P> -This directive controls whether <EM>all</EM> of the server's environment -variables should be made available to CGI scripts and SSI documents, -or only those explicitly named by -<A HREF="#passenv"><CODE>PassEnv</CODE></A> directives or otherwise -created by the server itself. -</P> -<BLOCKQUOTE><STRONG>It is highly recommended that this functionality -be enabled only with extreme caution and after careful examination -of whether the entire environment is needed.</STRONG></BLOCKQUOTE> -<P> -Because of security considerations, <CODE>PassAllEnv</CODE> may -only appear inside -<A HREF="core.html#directory"><SAMP><Directory></SAMP></A> and -<A HREF="core.html#location"><SAMP><Location></SAMP></A> -containers in the server configuration files. -</P> <HR> <H2><A NAME="passenv">PassEnv</A></H2> 1.28 +20 -125 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.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- mod_env.c 1999/03/21 16:52:32 1.27 +++ mod_env.c 1999/03/22 23:38:21 1.28 @@ -96,56 +96,24 @@ * *** configuration carefully before accepting this *** * *** version of the module in a live webserver which used *** * *** older versions of the module. *** - * 20.Mar.1999 Added PassAllEnv to allow copying of the entire parent - * process environment to CGIs and SSIs. */ #include "httpd.h" #include "http_config.h" -#ifdef WIN32 -__declspec(dllimport) char **environ; -#else -#include <unistd.h> -extern char **environ; -#endif - -/* - * Server-wide config info for this module - */ -typedef struct env_server_config_rec { +typedef struct { table *vars; - table *parent_env; char *unsetenv; int vars_present; } env_server_config_rec; -/* - * Per-directory config info - */ -typedef struct env_dir_config_rec { - int passall; -} env_dir_config_rec; - module MODULE_VAR_EXPORT env_module; -static void *create_env_dir_config(pool *p, char *dspec) -{ - env_dir_config_rec *dconf; - - dconf = ap_palloc(p, sizeof(env_dir_config_rec)); - dconf->passall = 0; - return dconf; -} - static void *create_env_server_config(pool *p, server_rec *dummy) { - env_server_config_rec *new; - - new = (env_server_config_rec *) ap_palloc(p, - sizeof(env_server_config_rec)); + env_server_config_rec *new = + (env_server_config_rec *) ap_palloc(p, sizeof(env_server_config_rec)); new->vars = ap_make_table(p, 50); - new->parent_env = NULL; new->unsetenv = ""; new->vars_present = 0; return (void *) new; @@ -155,7 +123,9 @@ { 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 *new = + (env_server_config_rec *) ap_palloc(p, sizeof(env_server_config_rec)); + table *new_table; table_entry *elts; array_header *arr; @@ -163,8 +133,6 @@ int i; const char *uenv, *unset; - new = (env_server_config_rec *) ap_palloc(p, - sizeof(env_server_config_rec)); /* * new_table = copy_table( p, base->vars ); * foreach $element ( @add->vars ) { @@ -235,8 +203,7 @@ if ((*name == '\0') || (*arg != '\0')) { - return "SetEnv takes one or two arguments. An environment " - "variable name and an optional value to pass to CGI."; + return "SetEnv takes one or two arguments. An environment variable name and an optional value to pass to CGI."; } sconf->vars_present = 1; @@ -247,65 +214,12 @@ static const char *add_env_module_vars_unset(cmd_parms *cmd, char *struct_ptr, char *arg) -{ - env_server_config_rec *sconf; - - sconf = ap_get_module_config(cmd->server->module_config, &env_module); - sconf->unsetenv = sconf->unsetenv - ? ap_pstrcat(cmd->pool, sconf->unsetenv, " ", arg, NULL) - : arg; - return NULL; -} - -/* - * Set up to make the entire server environment available through - * r->subprocess_env. - */ -static const char *add_env_module_passall(cmd_parms *cmd, void *mconfig, - int enable) { - env_dir_config_rec *dconf = (env_dir_config_rec *) mconfig; - - dconf->passall = enable; - if (enable) { - env_server_config_rec *sconf; - - sconf = (env_server_config_rec *) ap_get_module_config(cmd->server->module_config, - &env_module); - /* - * If we've copied the entire server environment before, it's - * in the server config record. Otherwise, do so now. - */ - if (sconf->parent_env == NULL) { - char **e = environ; - char *lhs; - char *rhs; - - sconf->parent_env = ap_make_table(cmd->pool, 30); - while (*e != NULL) { - /* - * Make a copy of the environment entry so we can split - * it into a key/value pair with '\0'. - */ - lhs = ap_pstrdup(cmd->pool, *e); - rhs = strchr(lhs, '='); - if (rhs == NULL) { - rhs = ""; - } - else { - *rhs = '\0'; - rhs++; - } - ap_table_setn(sconf->parent_env, lhs, rhs); - e++; - } - } - /* - * Note that there are variables to be copied during the fixup - * phase. - */ - sconf->vars_present++; - } + 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; return NULL; } @@ -313,12 +227,10 @@ { {"PassEnv", add_env_module_vars_passed, NULL, RSRC_CONF, 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."}, - {"UnsetEnv", add_env_module_vars_unset, NULL, RSRC_CONF, RAW_ARGS, - "a list of variables to remove from the CGI environment."}, - {"PassAllEnv", add_env_module_passall, NULL, ACCESS_CONF, FLAG, - "On or Off to control passing of entire server environment."}, + {"SetEnv", add_env_module_vars_set, NULL, + RSRC_CONF, 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."}, {NULL}, }; @@ -327,30 +239,13 @@ table *e = r->subprocess_env; server_rec *s = r->server; env_server_config_rec *sconf = ap_get_module_config(s->module_config, - &env_module); - env_dir_config_rec *dconf = ap_get_module_config(r->per_dir_config, - &env_module); + &env_module); table *vars = sconf->vars; - if (!sconf->vars_present) { + if (!sconf->vars_present) return DECLINED; - } - /* - * If the entire environment is supposed to be copied, do it. - */ - if (dconf->passall) { - r->subprocess_env = ap_overlay_tables(r->pool, r->subprocess_env, - sconf->parent_env); - } - else { - /* - * If we just copied the entire environment, we don't need to - * deal with the PassEnv settings because they were automatically - * included. Otherwise, do them now. - */ - r->subprocess_env = ap_overlay_tables(r->pool, e, vars); - } + r->subprocess_env = ap_overlay_tables(r->pool, e, vars); return OK; } @@ -359,7 +254,7 @@ { STANDARD_MODULE_STUFF, NULL, /* initializer */ - create_env_dir_config, /* dir config creater */ + NULL, /* dir config creater */ NULL, /* dir merger --- default is to override */ create_env_server_config, /* server config */ merge_env_server_configs, /* merge server configs */ 1.1290 +2 -1 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1289 retrieving revision 1.1290 diff -u -r1.1289 -r1.1290 --- CHANGES 1999/03/21 05:07:25 1.1289 +++ CHANGES 1999/03/22 23:38:21 1.1290 @@ -1,7 +1,8 @@ Changes with Apache 1.3.6 + *) Removed new PassAllEnv code due to DSO problems. [Lars Eilebrecht] -Changes with Apache 1.3.5 +Changes with Apache 1.3.5 [not released] *) M_INVALID needed a value within the scope of METHODS so that unknown methods can be access controlled. [Roy Fielding] PR#3821 1.43 +5 -8 apache-1.3/Announcement Index: Announcement =================================================================== RCS file: /export/home/cvs/apache-1.3/Announcement,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- Announcement 1999/03/21 04:15:27 1.42 +++ Announcement 1999/03/22 23:38:25 1.43 @@ -1,8 +1,8 @@ -Apache 1.3.5 Released +Apache 1.3.6 Released ===================== The Apache Group is pleased to announce the release of version -1.3.5 of the Apache HTTP server. +1.3.6 of the Apache HTTP server. This new Apache version incorporates over 60 significant improvements to the server. Apart from portability and security fixes, documentation @@ -29,9 +29,6 @@ - Improved content negotiation. - - New PassAllEnv directive; makes server's entire environment available - to CGIs and SSIs executed within directive's scope. - - New ScriptInterpreterSource directive to enable searching the Win32 registry for script interpreters. @@ -44,13 +41,13 @@ A complete listing with detailed descriptions is provided in the src/CHANGES file. -We consider Apache 1.3.5 to be the best version of Apache available and +We consider Apache 1.3.6 to be the best version of Apache available and we strongly recommend that users of older versions, especially of the 1.1.x and 1.2.x family, upgrade as soon as possible. No further releases will be made in the 1.2.x family. -Apache 1.3.5 is available for download from +Apache 1.3.6 is available for download from http://www.apache.org/dist/ @@ -61,7 +58,7 @@ http://www.apache.org/dist/binaries/ -As of Apache 1.3.5 binary distributions contain all standard Apache +As of Apache 1.3.6 binary distributions contain all standard Apache modules as shared objects (if supported by the platform) and include full source code. Installation is easily done by executing the included install script. See the README.bindist and INSTALL.bindist