cvs commit: apache-1.3/src/modules/standard mod_include.c
bjh 99/12/10 16:36:20 Modified:src/modules/standard mod_include.c Log: Clean up an unused variable warning. Revision ChangesPath 1.120 +1 -1 apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.119 retrieving revision 1.120 diff -u -r1.119 -r1.120 --- mod_include.c 1999/10/21 20:45:29 1.119 +++ mod_include.c 1999/12/11 00:36:17 1.120 @@ -786,7 +786,7 @@ FILE *dbg = fopen(/dev/tty, w); #endif #endif -#ifndef WIN32 +#if !defined(WIN32) !defined(OS2) char err_string[MAX_STRING_LEN]; #endif
cvs commit: apache-1.3/src/modules/standard mod_include.c
jim 99/05/21 16:58:01 Modified:src Configure src/helpers TestCompile src/modules/standard mod_include.c Log: The final phases of the great 'quad' update. ap_snprintf() can now handle quads, assuming the compiler knows about them, and we now determine which type is the off_t typedef Revision ChangesPath 1.347 +38 -0 apache-1.3/src/Configure Index: Configure === RCS file: /export/home/cvs/apache-1.3/src/Configure,v retrieving revision 1.346 retrieving revision 1.347 diff -u -r1.346 -r1.347 --- Configure 1999/05/17 08:00:03 1.346 +++ Configure 1999/05/21 23:57:48 1.347 @@ -1845,6 +1845,44 @@ fi +## More building ap_config_auto.h +## +## We check to see if this OS and/or compiler supports long-long +## +echo + checking for the long long data type +if ./helpers/TestCompile sizeof long long; then +AP_LONGEST_LONG=long long +else +AP_LONGEST_LONG=long +fi +echo $AP_CONFIG_AUTO_H +echo /* determine: longest possible integer type */ $AP_CONFIG_AUTO_H +echo #ifndef AP_LONGEST_LONG $AP_CONFIG_AUTO_H +echo #define AP_LONGEST_LONG $AP_LONGEST_LONG $AP_CONFIG_AUTO_H +echo #endif $AP_CONFIG_AUTO_H + +## +## Now compare the sizes of off_t to long +## +echo + determining if off_t is quad or long +AP_TYPE_OFF_T=`./helpers/TestCompile -r sizeof off_t` +AP_TYPE_LONG=`./helpers/TestCompile -r sizeof long` +if [ x$AP_TYPE_OFF_T != x ] [ x$AP_TYPE_OFF_T != x$AP_TYPE_LONG ] +then +echo $AP_CONFIG_AUTO_H +echo /* determine: is off_t a quad */ $AP_CONFIG_AUTO_H +echo #ifndef AP_OFF_T_IS_QUAD $AP_CONFIG_AUTO_H +echo #define AP_OFF_T_IS_QUAD 1 $AP_CONFIG_AUTO_H +echo #endif $AP_CONFIG_AUTO_H +else +echo $AP_CONFIG_AUTO_H +echo /* determine: is off_t a quad */ $AP_CONFIG_AUTO_H +echo #ifndef AP_OFF_T_IS_QUAD $AP_CONFIG_AUTO_H +echo #undef AP_OFF_T_IS_QUAD $AP_CONFIG_AUTO_H +echo #endif $AP_CONFIG_AUTO_H +fi + + ## Finish building ap_config_auto.h ## ## We pick out all -D's from CFLAGS and insert them as defines into 1.28 +33 -1 apache-1.3/src/helpers/TestCompile Index: TestCompile === RCS file: /export/home/cvs/apache-1.3/src/helpers/TestCompile,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- TestCompile 1999/04/28 08:40:44 1.27 +++ TestCompile 1999/05/21 23:57:53 1.28 @@ -22,6 +22,10 @@ # ./helpers/TestCompile sanity #Which does a simple sanity check/test compile # +# ./helpers/TestCompile sizeof type +#Which prints out the sizeof type (sure would be nice +#if sizeof could be use in preprocessor if's) +# # It does these by creating a small mini-makefile, based on # ../Makefile.config and trying to compile a small dummy # program. If the compilation succeeds, we assume the test @@ -41,8 +45,9 @@ cd ./helpers # -# Handle verbose and silent flags +# Handle verbose, silent and runit flags # +RUNIT=no case $1 in -v) VERBOSE=yes @@ -52,6 +57,10 @@ VERBOSE=no shift ;; +-r) +RUNIT=yes + shift + ;; esac # @@ -76,6 +85,26 @@ echo int main(void) { $3(); return(0); } testfunc.c fi ;; +sizeof) + if [ x$2 = x ]; then + exit + fi + TLIB= + if [ x$VERBOSE = xyes ]; then + ERRDIR= + else + ERRDIR='2/dev/null' + fi + TARGET='testfunc' + cat EOF testfunc.c +#include stdio.h +#include sys/types.h +int main(void) { +printf(%d\n, sizeof($2)); +return(0); +} +EOF + ;; sanity) TLIB= if [ x$VERBOSE = xno ]; then @@ -154,5 +183,8 @@ # have PrintPath just search this directory. if ./PrintPath -s -p`pwd` $TARGET ; then +if [ x$RUNIT = xyes ]; then + `pwd`/$TARGET +fi exstat=0 fi 1.118 +2 -3 apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.117 retrieving revision 1.118 diff -u -r1.117 -r1.118 --- mod_include.c 1999/05/21 12:16:25 1.117 +++ mod_include.c 1999/05/21 23:57:57 1.118 @@ -1134,9 +1134,8 @@ } else { int l, x; -#if defined(BSD) BSD 199305 -/* ap_snprintf can't handle %qd */ -
cvs commit: apache-1.3/src/modules/standard mod_include.c mod_autoindex.c
dgaudet 99/05/13 12:00:48 Modified:src/modules/standard mod_include.c mod_autoindex.c Log: Back out the evil hack portion of Raymond's patch. In addition to being an evil hack, it causes memory corruption. You cannot destroy a #included subrequest of mod_include... look for all uses of request_config in mod_include, in particular look at the code around the ap_join_pool call. Revision ChangesPath 1.116 +9 -40 apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.115 retrieving revision 1.116 diff -u -r1.115 -r1.116 --- mod_include.c 1999/05/13 18:25:57 1.115 +++ mod_include.c 1999/05/13 19:00:41 1.116 @@ -108,6 +108,9 @@ module MODULE_VAR_EXPORT includes_module; +/* just need some arbitrary non-NULL pointer which can't also be a request_rec */ +#define NESTED_INCLUDE_MAGIC (includes_module) + /* Environment function -- */ /* XXX: could use ap_table_overlap here */ @@ -743,7 +746,9 @@ } /* destroy the sub request if it's not a nested include */ - if (rr != NULL) { +if (rr != NULL + ap_get_module_config(rr-request_config, includes_module) + != NESTED_INCLUDE_MAGIC) { ap_destroy_sub_req(rr); } } @@ -2371,41 +2376,6 @@ return OK; } -#define SUB_REQ_STRING Sub request to mod_include -#define PARENT_STRINGParent request to mod_include - -if (ap_table_get(r-notes, SUB_REQ_STRING) != NULL) { - request_rec *p = r-main; - - /* - * The note is a flag to mod_include that this request is actually - * a subrequest from another module and that mod_include needs to - * treat it as if it's a subrequest from mod_include. - * - * HACK ALERT! - * There is no good way to pass the parent request_rec to mod_include. - * Tables only take string values and there is nowhere appropriate in - * in the request_rec that can safely be used. - * - * So we search up the chain of requests and redirects looking for - * the parent request. - */ - - while (p) { - if (ap_table_get(p-notes, PARENT_STRING) != NULL) { - /* Kludge --- See below */ - ap_set_module_config(r-request_config, includes_module, p); - - ap_add_common_vars(p); - ap_add_cgi_vars(p); - add_include_vars(p, DEFAULT_TIME_FORMAT); - ap_table_unset(r-notes, SUB_REQ_STRING); - break; - } - p = (p-prev) ? p-prev : p-main; - } -} - if ((parent = ap_get_module_config(r-request_config, includes_module))) { /* Kludge --- for nested includes, we want to keep the subprocess * environment of the base document (for compatibility); that means @@ -2441,10 +2411,9 @@ send_parsed_content(f, r); if (parent) { - /* Kludge --- Doing this allows the caller to safely destroy the - * sub_req - */ - r-pool = ap_make_sub_pool(r-pool); + /* signify that the sub request should not be killed */ + ap_set_module_config(r-request_config, includes_module, + NESTED_INCLUDE_MAGIC); } ap_kill_timeout(r); 1.108 +0 -8 apache-1.3/src/modules/standard/mod_autoindex.c Index: mod_autoindex.c === RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_autoindex.c,v retrieving revision 1.107 retrieving revision 1.108 diff -u -r1.107 -r1.108 --- mod_autoindex.c 1999/05/13 18:25:56 1.107 +++ mod_autoindex.c 1999/05/13 19:00:43 1.108 @@ -924,10 +924,6 @@ ap_rputs(/PRE\n, r); } -/* See mod_include */ -#define SUB_REQ_STRING Sub request to mod_include -#define PARENT_STRINGParent request to mod_include - /* * Handle the preamble through the H1 tag line, inclusive. Locate * the file with a subrequests. Process text/html documents by actually @@ -969,8 +965,6 @@ if (! suppress_amble) { emit_preamble(r, title); } - ap_table_add(r-notes, PARENT_STRING, ); - ap_table_add(rr-notes, SUB_REQ_STRING, ); /* * If there's a problem running the subrequest, display the * preamble if we didn't do it before -- the header file @@ -1045,8 +1039,6 @@ */ if (rr-content_type != NULL) { if (!strcasecmp(text/html, rr-content_type)) { -
cvs commit: apache-1.3/src/modules/standard mod_include.c
dgaudet 99/05/05 10:46:08 Modified:src CHANGES src/modules/standard mod_include.c Log: mod_include's fsize/flastmod should allow only relative paths, just like include file. This bug was introduced during the 1.98 - 1.99 rev of mod_include. Submitted by: Jaroslav Benkovsky [EMAIL PROTECTED] Revision ChangesPath 1.1347+3 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1346 retrieving revision 1.1347 diff -u -r1.1346 -r1.1347 --- CHANGES 1999/05/04 11:21:07 1.1346 +++ CHANGES 1999/05/05 17:46:05 1.1347 @@ -1,5 +1,8 @@ Changes with Apache 1.3.7 + *) mod_include's fsize/flastmod should allow only relative paths, just + like include file. [Jaroslav Benkovsky [EMAIL PROTECTED]] + *) OS/2: Add support for building loadable modules using DLLs. [Brian Havard] 1.114 +26 -20apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.113 retrieving revision 1.114 diff -u -r1.113 -r1.114 --- mod_include.c 1999/04/27 20:36:35 1.113 +++ mod_include.c 1999/05/05 17:46:07 1.114 @@ -1045,35 +1045,41 @@ static int find_file(request_rec *r, const char *directive, const char *tag, char *tag_val, struct stat *finfo, const char *error) { -char *to_send; -request_rec *rr; +char *to_send = tag_val; +request_rec *rr = NULL; int ret=0; +char *error_fmt = NULL; if (!strcmp(tag, file)) { -ap_getparents(tag_val);/* get rid of any nasties */ - -rr = ap_sub_req_lookup_file(tag_val, r); +/* be safe; only files in this directory or below allowed */ +if (!is_only_below(tag_val)) { +error_fmt = unable to access file \%s\ +in parsed file %s; +} +else { +ap_getparents(tag_val);/* get rid of any nasties */ +rr = ap_sub_req_lookup_file(tag_val, r); -if (rr-status == HTTP_OK rr-finfo.st_mode != 0) { -to_send = rr-filename; -if ((ret = stat(to_send, finfo)) == -1) { -ap_log_rerror(APLOG_MARK, APLOG_ERR, r, -unable to get information about \%s\ -in parsed file %s, -to_send, r-filename); -ap_rputs(error, r); +if (rr-status == HTTP_OK rr-finfo.st_mode != 0) { +to_send = rr-filename; +if (stat(to_send, finfo)) { +error_fmt = unable to get information about \%s\ +in parsed file %s; +} +} +else { +error_fmt = unable to lookup information about \%s\ +in parsed file %s; } } -else { + +if (error_fmt) { ret = -1; -ap_log_rerror(APLOG_MARK, APLOG_ERR, r, -unable to lookup information about \%s\ -in parsed file %s, -tag_val, r-filename); +ap_log_rerror(APLOG_MARK, APLOG_ERR, r, error_fmt, to_send, r-filename); ap_rputs(error, r); } - -ap_destroy_sub_req(rr); + +if (rr) ap_destroy_sub_req(rr); return ret; }
cvs commit: apache-1.3/src/modules/standard mod_include.c
dougm 98/11/30 14:26:49 Modified:src CHANGES src/modules/standard mod_include.c Log: mod_include.c:handle_perl() now properly tests for OPT_INCNOEXEC rather than OPT_INCLUDES Submitted by: Rainer Schoepf [EMAIL PROTECTED] Reviewed by: Doug MacEachern Revision ChangesPath 1.1152+2 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1151 retrieving revision 1.1152 diff -u -r1.1151 -r1.1152 --- CHANGES 1998/11/25 04:36:10 1.1151 +++ CHANGES 1998/11/30 22:26:47 1.1152 @@ -1,4 +1,6 @@ Changes with Apache 1.3.4 + *) mod_include.c:handle_perl() now properly tests for OPT_INCNOEXEC + rather than OPT_INCLUDES [Rainer Schoepf [EMAIL PROTECTED]] *) ap_md5_binary() was using sprintf() rather than a table lookup to convert binary bytes to hex digits. 1.107 +1 -1 apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.106 retrieving revision 1.107 diff -u -r1.106 -r1.107 --- mod_include.c 1998/11/09 07:03:19 1.106 +++ mod_include.c 1998/11/30 22:26:49 1.107 @@ -952,7 +952,7 @@ SV *sub = Nullsv; AV *av = newAV(); -if (!(ap_allow_options(r) OPT_INCLUDES)) { +if (ap_allow_options(r) OPT_INCNOEXEC) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r, httpd: #perl SSI disallowed by IncludesNoExec in %s, r-filename);
cvs commit: apache-1.3/src/modules/standard mod_include.c
dougm 98/09/24 07:06:42 Modified:src CHANGES src/modules/standard mod_include.c Log: The Perl %ENV hash will now be setup by default when using the mod_include `perl' command Revision ChangesPath 1.1076+3 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1075 retrieving revision 1.1076 diff -u -r1.1075 -r1.1076 --- CHANGES 1998/09/24 10:21:58 1.1075 +++ CHANGES 1998/09/24 14:06:40 1.1076 @@ -1,5 +1,8 @@ Changes with Apache 1.3.3 + *) The Perl %ENV hash will now be setup by default when using the + mod_include `perl' command [Doug MacEachern] + *) PORT: Add Pyramid DC/OSx support to configuration mechanism. [Earle Ake [EMAIL PROTECTED]] 1.105 +1 -0 apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.104 retrieving revision 1.105 diff -u -r1.104 -r1.105 --- mod_include.c 1998/09/07 03:42:03 1.104 +++ mod_include.c 1998/09/24 14:06:42 1.105 @@ -946,6 +946,7 @@ } } perl_stdout2client(r); +perl_setup_env(r); perl_call_handler(sub, r, av); return OK; }
cvs commit: apache-1.3/src/modules/standard mod_include.c
dgaudet 98/07/20 09:33:58 Modified:src CHANGES src/modules/standard mod_include.c Log: use sub_req_lookup_file for fsize and flastmod. PR: 2355 Submitted by: Manoj Kasichainula [EMAIL PROTECTED] Reviewed by: Brian, Dean Revision ChangesPath 1.971 +9 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.970 retrieving revision 1.971 diff -u -r1.970 -r1.971 --- CHANGES 1998/07/18 22:50:15 1.970 +++ CHANGES 1998/07/20 16:33:56 1.971 @@ -1,3 +1,12 @@ +Changes with Apache 1.3.2 + + *) mod_include had problems with the fsize and flastmod directives + under WIN32. Fix also avoids the minor security hole of using + .. paths for fsize and flastmod. + [Manoj Kasichainula [EMAIL PROTECTED]] PR#2355 + + *) Fixed some Makefile dependency problems. [Dean Gaudet] + Changes with Apache 1.3.1 *) Disable the incorrect entry for application/msword in the 1.99 +24 -7 apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.98 retrieving revision 1.99 diff -u -r1.98 -r1.99 --- mod_include.c 1998/07/08 17:47:16 1.98 +++ mod_include.c 1998/07/20 16:33:57 1.99 @@ -1004,22 +1004,39 @@ char *tag_val, struct stat *finfo, const char *error) { char *to_send; +request_rec *rr; +int ret=0; if (!strcmp(tag, file)) { ap_getparents(tag_val);/* get rid of any nasties */ -to_send = ap_make_full_path(r-pool, ./, tag_val); -if (stat(to_send, finfo) == -1) { + +rr = ap_sub_req_lookup_file(tag_val, r); + +if (rr-status == HTTP_OK rr-finfo.st_mode != 0) { +to_send = rr-filename; +if ((ret = stat(to_send, finfo)) == -1) { +ap_log_error(APLOG_MARK, APLOG_ERR, r-server, +unable to get information about \%s\ +in parsed file %s, +to_send, r-filename); +ap_rputs(error, r); +} +} +else { +ret = -1; ap_log_error(APLOG_MARK, APLOG_ERR, r-server, -unable to get information about \%s\ +unable to lookup information about \%s\ in parsed file %s, -to_send, r-filename); +tag_val, r-filename); ap_rputs(error, r); -return -1; } -return 0; + +ap_destroy_sub_req(rr); + +return ret; } else if (!strcmp(tag, virtual)) { -request_rec *rr = ap_sub_req_lookup_uri(tag_val, r); +rr = ap_sub_req_lookup_uri(tag_val, r); if (rr-status == HTTP_OK rr-finfo.st_mode != 0) { memcpy((char *) finfo, (const char *) rr-finfo,
cvs commit: apache-1.3/src/modules/standard mod_include.c
dougm 98/06/30 18:37:31 Modified:.STATUS src CHANGES src/include hsregex.h src/modules/standard mod_include.c Log: add support for #perl arg interpolation in mod_include Submitted by: Doug MacEachern Reviewed by: Dean Gaudet, Howard Fear Revision ChangesPath 1.434 +1 -5 apache-1.3/STATUS Index: STATUS === RCS file: /export/home/cvs/apache-1.3/STATUS,v retrieving revision 1.433 retrieving revision 1.434 diff -u -r1.433 -r1.434 --- STATUS1998/06/30 08:09:13 1.433 +++ STATUS1998/07/01 01:37:26 1.434 @@ -22,7 +22,7 @@ situation it runs fine. Sure, its mod_perl's fault because its mod_perl code which returns DECLINED. But it definitely seems to be caused by a missing init in mod_so under DSO situation. I've already asked Doug for - hints but he still has no clue. + hints but he has not had a chance to look into it. Currently at least mod_perl is broken under the DSO situation because of this missing init in mod_so. But perhaps there are more modules which @@ -48,10 +48,6 @@ * Filenames containing whitespace characters caused problems for directives Bill Stoddard [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED] - -* Fix mod_include #perl arg interpolation - Doug MacEachern [EMAIL PROTECTED] - Message-Id: [EMAIL PROTECTED] * PR#2483 reports that RewriteMap program still don't work under Win32 because of a SIGSEGV. The reporter is right, ap_spawn_child_core() calls the child 1.942 +3 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.941 retrieving revision 1.942 diff -u -r1.941 -r1.942 --- CHANGES 1998/06/30 08:08:33 1.941 +++ CHANGES 1998/07/01 01:37:27 1.942 @@ -1,5 +1,8 @@ Changes with Apache 1.3.1 + *) add support for #perl arg interpolation in mod_include + [Doug MacEachern] + *) API: Name changes of table_elts to ap_table_elts and is_table_empty to ap_is_table_empty. [Ben Laurie] 1.6 +0 -2 apache-1.3/src/include/hsregex.h Index: hsregex.h === RCS file: /export/home/cvs/apache-1.3/src/include/hsregex.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- hsregex.h 1998/04/06 05:21:41 1.5 +++ hsregex.h 1998/07/01 01:37:29 1.6 @@ -6,12 +6,10 @@ #endif /* === regex2.h === */ -#ifndef API_EXPORT #ifdef WIN32 #define API_EXPORT(type)__declspec(dllexport) type __stdcall #else #define API_EXPORT(type)type -#endif #endif typedef off_t regoff_t; 1.97 +3 -1 apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.96 retrieving revision 1.97 diff -u -r1.96 -r1.97 --- mod_include.c 1998/06/27 18:09:32 1.96 +++ mod_include.c 1998/07/01 01:37:29 1.97 @@ -918,6 +918,7 @@ static int handle_perl(FILE *in, request_rec *r, const char *error) { char tag[MAX_STRING_LEN]; +char parsed_string[MAX_STRING_LEN]; char *tag_val; SV *sub = Nullsv; AV *av = newAV(); @@ -936,7 +937,8 @@ sub = newSVpv(tag_val, 0); } else if (strnEQ(tag, arg, 3)) { -av_push(av, newSVpv(tag_val, 0)); +parse_string(r, tag_val, parsed_string, sizeof(parsed_string), 0); +av_push(av, newSVpv(parsed_string, 0)); } else if (strnEQ(tag, done, 4)) { break;
cvs commit: apache-1.3/src/modules/standard mod_include.c
dgaudet 98/05/25 17:54:08 Modified:src CHANGES src/modules/standard mod_include.c Log: $ followed by non alnum should expand to $... I broke this in 1.2.5 security stuff. PR: 1921, 2249 Revision ChangesPath 1.862 +4 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.861 retrieving revision 1.862 diff -u -r1.861 -r1.862 --- CHANGES 1998/05/25 17:58:16 1.861 +++ CHANGES 1998/05/26 00:54:06 1.862 @@ -1,5 +1,9 @@ Changes with Apache 1.3b8 + *) A zero-length name after a $ in an SSI document should cause + just the $ to be in the expansion. This was broken during the + security fixes in 1.2.5. [Dean Gaudet] PR#1921, 2249 + *) Call ap_destroy_sub_req() in ap_add_cgi_vars() to reclaim some memory. [Rob Saccoccio [EMAIL PROTECTED]] PR#2252 1.92 +17 -11apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.91 retrieving revision 1.92 diff -u -r1.91 -r1.92 --- mod_include.c 1998/05/20 19:41:11 1.91 +++ mod_include.c 1998/05/26 00:54:07 1.92 @@ -532,20 +532,26 @@ /* what a pain, too bad there's no table_getn where you can * pass a non-nul terminated string */ l = end_of_var_name - start_of_var_name; - l = (l sizeof(var) - 1) ? (sizeof(var) - 1) : l; - memcpy(var, start_of_var_name, l); - var[l] = '\0'; + if (l != 0) { + l = (l sizeof(var) - 1) ? (sizeof(var) - 1) : l; + memcpy(var, start_of_var_name, l); + var[l] = '\0'; - val = ap_table_get(r-subprocess_env, var); - if (val) { - expansion = val; - l = strlen(expansion); + val = ap_table_get(r-subprocess_env, var); + if (val) { + expansion = val; + l = strlen(expansion); + } + else if (leave_name) { + l = in - expansion; + } + else { + break; /* no expansion to be done */ + } } - else if (leave_name) { - l = in - expansion; - } else { - break; /* no expansion to be done */ + /* zero-length variable name causes just the $ to be copied */ + l = 1; } l = (l end_out - next) ? (end_out - next) : l; memcpy(next, expansion, l);
cvs commit: apache-1.3/src/modules/standard mod_include.c mod_log_agent.c mod_log_referer.c
brian 98/05/19 16:48:37 Modified:src/modules/standard mod_include.c mod_log_agent.c mod_log_referer.c Log: Added some error warnings back. Revision ChangesPath 1.90 +2 -0 apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.89 retrieving revision 1.90 diff -u -r1.89 -r1.90 --- mod_include.c 1998/05/19 22:49:03 1.89 +++ mod_include.c 1998/05/19 23:48:35 1.90 @@ -818,6 +818,8 @@ if (!ap_spawn_child_err_buff(r-pool, include_cmd_child, arg, kill_after_timeout, NULL, script_in, NULL)) { +ap_log_error(APLOG_MARK, APLOG_ERR, r-server, + couldn't spawn include command); return -1; } 1.26 +2 -0 apache-1.3/src/modules/standard/mod_log_agent.c Index: mod_log_agent.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_log_agent.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- mod_log_agent.c 1998/05/19 22:49:03 1.25 +++ mod_log_agent.c 1998/05/19 23:48:36 1.26 @@ -117,6 +117,8 @@ pl = ap_open_piped_log(p, cls-fname + 1); if (pl == NULL) { + ap_log_error(APLOG_MARK, APLOG_ERR, s, + couldn't spawn agent log pipe); exit(1); } cls-agent_fd = ap_piped_log_write_fd(pl); 1.27 +2 -0 apache-1.3/src/modules/standard/mod_log_referer.c Index: mod_log_referer.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_log_referer.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- mod_log_referer.c 1998/05/19 22:49:03 1.26 +++ mod_log_referer.c 1998/05/19 23:48:36 1.27 @@ -132,6 +132,8 @@ pl = ap_open_piped_log(p, cls-fname + 1); if (pl == NULL) { + ap_log_error(APLOG_MARK, APLOG_ERR, s, + couldn't spawn referer log pipe); exit(1); }
Re: cvs commit: apache-1.3/src/modules/standard mod_include.c mod_log_agent.c mod_log_referer.c mod_mime_magic.c
[EMAIL PROTECTED] wrote: +cls-agent_fd = ap_piped_log_write_fd(pl); Not so sure about this ... surely it can't be an fd if it works for Win32? Cheers, Ben. -- Ben Laurie|Phone: +44 (181) 735 0686| Apache Group member Freelance Consultant |Fax: +44 (181) 735 0689|http://www.apache.org and Technical Director|Email: [EMAIL PROTECTED] | A.L. Digital Ltd, |Apache-SSL authorhttp://www.apache-ssl.org/ London, England. |Apache: TDG http://www.ora.com/catalog/apache
cvs commit: apache-1.3/src/modules/standard mod_include.c
ben 98/05/20 12:41:12 Modified:src/modules/standard mod_include.c Log: Re-enable include_cmd for Win32. Revision ChangesPath 1.91 +0 -2 apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.90 retrieving revision 1.91 diff -u -r1.90 -r1.91 --- mod_include.c 1998/05/19 23:48:35 1.90 +++ mod_include.c 1998/05/20 19:41:11 1.91 @@ -729,7 +729,6 @@ } } -#ifndef WIN32 typedef struct { request_rec *r; char *s; @@ -827,7 +826,6 @@ ap_bclose(script_in); return 0; } -#endif static int handle_exec(FILE *in, request_rec *r, const char *error) {
cvs commit: apache-1.3/src/modules/standard mod_include.c mod_log_agent.c mod_log_referer.c mod_mime_magic.c
brian 98/05/19 15:49:05 Modified:.STATUS src CHANGES src/modules/standard mod_include.c mod_log_agent.c mod_log_referer.c mod_mime_magic.c Log: Two things: replaced the use of spawn_child with ap_spawn_child_err_buff in various modules (to be safe under Win32) and modified the agent and referer logging modules to use ap_open_piped_logs rather than try and do it on their own. I'm not sure that uncompress_child in mod_mime_magic is correct; could someone look at it? Also, Ralf, mod_rewrite.c needs similar treatment. I was off to do it but it looked more complex than the other changes, and I'm sure once you see the changes made here you can understand which mod_rewrite changes to make. Revision ChangesPath 1.402 +9 -10 apache-1.3/STATUS Index: STATUS === RCS file: /export/home/cvs/apache-1.3/STATUS,v retrieving revision 1.401 retrieving revision 1.402 diff -u -r1.401 -r1.402 --- STATUS1998/05/16 16:35:33 1.401 +++ STATUS1998/05/19 22:48:52 1.402 @@ -17,14 +17,11 @@ for buffer overflow, someone should rewrite or verify they're safe - * SSI: mod_include has had cmd disabled pending rewrite to use - new Win32 spawning. +* CGI: chdir() needs to be reinstated for CGI. - * CGI: chdir() needs to be reinstated for CGI. +* Child process: eliminate spawn_child() and spawn_child_err() which + are unsafe in mod_rewrite.c - * Child process: eliminate spawn_child() and spawn_child_err() which - are unsafe. - Documentation that needs writing: * Documentation for: @@ -218,8 +215,7 @@ really bad * chdir() for CGI scripts and mod_include #exec needs to be - re-implemented. This requires either serializing chdir/spawn - or using a native Win32 CreateProcess(?) call. + re-implemented now that CreateProcess is being used. * process/thread model - need dynamic thread creation/destruction, similar to @@ -247,8 +243,6 @@ * we don't mmap on NT. Use TransmitFile? * CGIs -- hangs on multiple CGI execution? PR#1607,1129 - Marc can't repeat... - docs on how they work w/scripts - use registry to find interpreter? - WTF is the buffering coming from? @@ -369,4 +363,9 @@ 5) would be nice if the proxy used Via and Max-Forwards, even as HTTP/1.0 * #ifdef __EMX__ -- #ifdef OS2. + +* use of spawnvp in uncompress_child in mod_mime_magic - doesn't + use the new child_info structure, is this still safe? Needs to be + looked at. + 1.853 +9 -2 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.852 retrieving revision 1.853 diff -u -r1.852 -r1.853 --- CHANGES 1998/05/18 21:56:06 1.852 +++ CHANGES 1998/05/19 22:48:57 1.853 @@ -1,5 +1,12 @@ Changes with Apache 1.3b7 + *) Mod_log_agent, mod_log_referer now use ap_open_piped_log for piped logs. + [Brian Behlendorf] + + *) Replace use of spawn_child with ap_spawn_child_err_buff, to make everything + safe under Win32. In: mod_include.c, mod_mime_magic.c + [Brian Behlendorf] + *) Improve RFC1413 support. [Bob Beck [EMAIL PROTECTED]] *) Fix support script `dbmmanage': It was unable to handle some sort @@ -11,8 +18,8 @@ *) WIN32: CGIs could cause a hang (because of a deadlock in the standard C library), so CGI handling has been changed to use Win32 native handles - instead of C file descriptors. - [Ben Laurie and Bill Stoddard [EMAIL PROTECTED]] PR#1129, 1607 + instead of C file descriptors. + [Ben Laurie and Bill Stoddard [EMAIL PROTECTED]] PR#1129, 1607 *) The proxy cache would store an incorrect content-length in the cached file copy after a cache update. That resulted in repeated fetching 1.89 +6 -13 apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.88 retrieving revision 1.89 diff -u -r1.88 -r1.89 --- mod_include.c 1998/05/19 19:19:01 1.88 +++ mod_include.c 1998/05/19 22:49:03 1.89 @@ -786,7 +786,7 @@ #endif ap_cleanup_for_exec(); /* set shellcmd flag to pass arg to SHELL_PATH */ -child_pid = ap_call_exec(r, NULL, s, ap_create_environment(r-pool, env), +child_pid = ap_call_exec(r, pinfo, s, ap_create_environment(r-pool, env),
cvs commit: apache-1.3/src/modules/standard mod_include.c
martin 98/04/20 08:28:37 Modified:src/modules/standard mod_include.c Log: Fix EBCDIC conversion flag for subrequests (#include virtual=) Revision ChangesPath 1.83 +0 -3 apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.82 retrieving revision 1.83 diff -u -u -r1.82 -r1.83 --- mod_include.c 1998/04/12 05:50:36 1.82 +++ mod_include.c 1998/04/20 15:28:36 1.83 @@ -692,9 +692,6 @@ if (rr) ap_set_module_config(rr-request_config, includes_module, r); -#ifdef CHARSET_EBCDIC -ap_bsetflag(rr-connection-client, B_EBCDIC2ASCII, 0); -#endif if (!error_fmt ap_run_sub_req(rr)) { error_fmt = unable to include \%s\ in parsed file %s; }
cvs commit: apache-1.3/src/modules/standard mod_include.c
marc98/04/11 22:50:37 Modified:src/modules/standard mod_include.c Log: Skip the nested include kludge of the subreq doesn't exist because it wasn't permitted. This avoids dereferencing a null pointer. PR: 2037 Revision ChangesPath 1.82 +2 -1 apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.81 retrieving revision 1.82 diff -u -r1.81 -r1.82 --- mod_include.c 1998/04/11 12:00:47 1.81 +++ mod_include.c 1998/04/12 05:50:36 1.82 @@ -689,7 +689,8 @@ } /* see the Kludge in send_parsed_file for why */ - ap_set_module_config(rr-request_config, includes_module, r); + if (rr) + ap_set_module_config(rr-request_config, includes_module, r); #ifdef CHARSET_EBCDIC ap_bsetflag(rr-connection-client, B_EBCDIC2ASCII, 0);
cvs commit: apache-1.3/src/modules/standard mod_include.c
dgaudet 98/03/10 01:42:46 Modified:src/modules/standard mod_include.c Log: Oh this is a nice one. I hope to followup to new-httpd about this one eventually. signals are a mess. It's bogus for mod_include to be doing a hard_timeout() and then running subrequests and all that other fun stuff. Revision ChangesPath 1.74 +5 -0 apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- mod_include.c 1998/02/21 12:26:22 1.73 +++ mod_include.c 1998/03/10 09:42:45 1.74 @@ -2311,6 +2311,11 @@ add_cgi_vars(r); add_include_vars(r, DEFAULT_TIME_FORMAT); } +/* XXX: this is bogus, at some point we're going to do a subrequest, + * and when we do it we're going to be subjecting code that doesn't + * expect to be signal-ready to SIGALRM. There is no clean way to + * fix this, except to put alarm support into BUFF. -djg + */ hard_timeout(send SSI, r); #ifdef CHARSET_EBCDIC
cvs commit: apache-1.3/src/modules/standard mod_include.c
dgaudet 98/02/21 03:46:00 Modified:src CHANGES src/modules/standard mod_include.c Log: Work around a broken cpp. PR: 1717 Revision ChangesPath 1.648 +3 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.647 retrieving revision 1.648 diff -u -r1.647 -r1.648 --- CHANGES 1998/02/21 10:43:42 1.647 +++ CHANGES 1998/02/21 11:45:56 1.648 @@ -1,5 +1,8 @@ Changes with Apache 1.3b6 + *) Work around a broken C preprocessor in mod_include. + [Dean Gaudet] PR#1717 + *) Use SA_RESETHAND or SA_ONESHOT when installing the coredump handlers. In particular the handlers could trigger themselves into an infinite loop if RLimitMem was used with a small amount of memory -- too small 1.72 +3 -1 apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -r1.71 -r1.72 --- mod_include.c 1998/02/03 09:30:48 1.71 +++ mod_include.c 1998/02/21 11:45:59 1.72 @@ -1049,9 +1049,11 @@ } else { int l, x; -#if defined(BSD) BSD 199305 +#if defined(BSD) +#if BSD 199305 /* ap_snprintf can't handle %qd */ sprintf(tag, %qd, finfo.st_size); +#endif #else ap_snprintf(tag, sizeof(tag), %ld, finfo.st_size); #endif
cvs commit: apache-1.3/src/modules/standard mod_include.c
dgaudet 98/02/21 04:26:23 Modified:src CHANGES src/modules/standard mod_include.c Log: boy that was a dumb patch, back it out Revision ChangesPath 1.649 +0 -3 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.648 retrieving revision 1.649 diff -u -r1.648 -r1.649 --- CHANGES 1998/02/21 11:45:56 1.648 +++ CHANGES 1998/02/21 12:26:20 1.649 @@ -1,8 +1,5 @@ Changes with Apache 1.3b6 - *) Work around a broken C preprocessor in mod_include. - [Dean Gaudet] PR#1717 - *) Use SA_RESETHAND or SA_ONESHOT when installing the coredump handlers. In particular the handlers could trigger themselves into an infinite loop if RLimitMem was used with a small amount of memory -- too small 1.73 +1 -3 apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- mod_include.c 1998/02/21 11:45:59 1.72 +++ mod_include.c 1998/02/21 12:26:22 1.73 @@ -1049,11 +1049,9 @@ } else { int l, x; -#if defined(BSD) -#if BSD 199305 +#if defined(BSD) BSD 199305 /* ap_snprintf can't handle %qd */ sprintf(tag, %qd, finfo.st_size); -#endif #else ap_snprintf(tag, sizeof(tag), %ld, finfo.st_size); #endif