cvs commit: apachen STATUS
dgaudet 97/12/22 17:51:28 Modified:.STATUS Log: two patches I posted today Revision ChangesPath 1.17 +8 -0 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- STATUS1997/12/23 01:49:58 1.16 +++ STATUS1997/12/23 01:51:26 1.17 @@ -52,6 +52,14 @@ Available: +* Dean's [PATCH] more useful warning message for fcntl() lock failure + [EMAIL PROTECTED] + Status: Dean +1, Jim +1 + +* Dean's [PATCH] ap_snprintf should be more sane (fwd) + [EMAIL PROTECTED] + Status: Dean +1, Jim +1 + * Igor Tatarinov's Re: A tiny correction and a question on writev_it_all [EMAIL PROTECTED] Status: Dean +1, Jim +1
cvs commit: apachen/src/main buff.c
dgaudet 97/12/22 18:03:55 Modified:.STATUS src CHANGES src/main buff.c Log: remove some dead code Submitted by: Igor Tatarinov [EMAIL PROTECTED] Reviewed by: Dean Gaudet, Jim Jagielski Revision ChangesPath 1.18 +1 -4 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- STATUS1997/12/23 01:51:26 1.17 +++ STATUS1997/12/23 02:03:51 1.18 @@ -49,6 +49,7 @@ * Dean's [PATCH] util_date.c needless reinitialization * Martin's [PATCH] Gimme a break! (missing break;s in mod_include) * Dean's [PATCH] two bugs in mod_autoindex +* Igor Tatarinov's Re: A tiny correction and a question on writev_it_all Available: @@ -58,10 +59,6 @@ * Dean's [PATCH] ap_snprintf should be more sane (fwd) [EMAIL PROTECTED] - Status: Dean +1, Jim +1 - -* Igor Tatarinov's Re: A tiny correction and a question on writev_it_all - [EMAIL PROTECTED] Status: Dean +1, Jim +1 * Dean's [PATCH] Re: [BUGFIXES] Wrong GID for PID file and UMASK for logs 1.537 +3 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.536 retrieving revision 1.537 diff -u -r1.536 -r1.537 --- CHANGES 1997/12/23 01:50:00 1.536 +++ CHANGES 1997/12/23 02:03:52 1.537 @@ -1,4 +1,7 @@ Changes with Apache 1.3b4 + + *) Eliminate some dead code from writev_it_all(). + [Igor Tatarinov [EMAIL PROTECTED]] *) mod_autoindex had an fread() without checking the result code. It also wouldn't handle AddIconByType (TXT,/icons/text.gif text/* 1.52 +0 -3 apachen/src/main/buff.c Index: buff.c === RCS file: /export/home/cvs/apachen/src/main/buff.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- buff.c1997/11/13 20:37:57 1.51 +++ buff.c1997/12/23 02:03:54 1.52 @@ -898,9 +898,6 @@ vec[i].iov_base = (char *) vec[i].iov_base + rv; vec[i].iov_len -= rv; rv = 0; - if (vec[i].iov_len == 0) { - ++i; - } } else { rv -= vec[i].iov_len;
cvs commit: apachen/src/main http_main.c
dgaudet 97/12/23 12:33:44 Modified:.STATUS src CHANGES src/main http_main.c Log: tell users to try the LockFile directive when a fcntl() locking error occurs. Reviewed by: Jim Jagielski, Ken Coar Revision ChangesPath 1.20 +1 -4 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- STATUS1997/12/23 19:55:54 1.19 +++ STATUS1997/12/23 20:33:38 1.20 @@ -50,12 +50,9 @@ * Martin's [PATCH] Gimme a break! (missing break;s in mod_include) * Dean's [PATCH] two bugs in mod_autoindex * Igor Tatarinov's Re: A tiny correction and a question on writev_it_all +* Dean's [PATCH] more useful warning message for fcntl() lock failure Available: - -* Dean's [PATCH] more useful warning message for fcntl() lock failure - [EMAIL PROTECTED] - Status: Dean +1, Jim +1, Ken +1 * Dean's [PATCH] ap_snprintf should be more sane (fwd) [EMAIL PROTECTED] 1.538 +3 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.537 retrieving revision 1.538 diff -u -r1.537 -r1.538 --- CHANGES 1997/12/23 02:03:52 1.537 +++ CHANGES 1997/12/23 20:33:40 1.538 @@ -1,4 +1,7 @@ Changes with Apache 1.3b4 + + *) When an error occurs in fcntl() locking suggest the user look up + the docs for LockFile. [Dean Gaudet] *) Eliminate some dead code from writev_it_all(). [Igor Tatarinov [EMAIL PROTECTED]] 1.259 +15 -5 apachen/src/main/http_main.c Index: http_main.c === RCS file: /export/home/cvs/apachen/src/main/http_main.c,v retrieving revision 1.258 retrieving revision 1.259 diff -u -r1.258 -r1.259 --- http_main.c 1997/12/21 01:54:39 1.258 +++ http_main.c 1997/12/23 20:33:42 1.259 @@ -592,21 +592,31 @@ { int ret; -while ((ret = fcntl(lock_fd, F_SETLKW, lock_it)) 0 errno == EINTR) - continue; +while ((ret = fcntl(lock_fd, F_SETLKW, lock_it)) 0 errno == EINTR) { + /* nop */ +} if (ret 0) { aplog_error(APLOG_MARK, APLOG_EMERG, server_conf, - fcntl: F_SETLKW: Error getting accept lock. Exiting!); + fcntl: F_SETLKW: Error getting accept lock, exiting! + Perhaps you need to use the LockFile directive to place + your lock file on a local disk!); exit(1); } } static void accept_mutex_off(void) { -if (fcntl(lock_fd, F_SETLKW, unlock_it) 0) { +int ret; + +while ((ret = fcntl(lock_fd, F_SETLKW, unlock_it)) 0 errno == EINTR) { + /* nop */ +} +if (ret 0) { aplog_error(APLOG_MARK, APLOG_EMERG, server_conf, - fcntl: F_SETLKW: Error freeing accept lock. Exiting!); + fcntl: F_SETLKW: Error freeing accept lock, exiting! + Perhaps you need to use the LockFile directive to place + your lock file on a local disk!); exit(1); } }
cvs commit: apachen STATUS
dgaudet 97/12/24 10:32:27 Modified:.STATUS Log: vote Revision ChangesPath 1.27 +1 -1 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- STATUS1997/12/24 16:43:14 1.26 +++ STATUS1997/12/24 18:32:26 1.27 @@ -58,7 +58,7 @@ * Ken's [PATCH] for PR#1195 ( in realm names) [EMAIL PROTECTED] - Status: Ken +1 + Status: Ken +1, Dean +1 * Dean's [PATCH] Re: [BUGFIXES] Wrong GID for PID file and UMASK for logs [EMAIL PROTECTED]
cvs commit: apachen/src/main buff.c
dgaudet 97/12/26 10:21:47 Modified:.STATUS src CHANGES src/main buff.c Log: Fix problem with chunking and bputc(). Don't use large_write() when nbytes == 1... otherwise we have really bad performance at end of buffer with bputc(). Reviewed by: Rasmus Lerdorf, Jim Jagielski Revision ChangesPath 1.31 +5 -4 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- STATUS1997/12/26 18:16:14 1.30 +++ STATUS1997/12/26 18:21:43 1.31 @@ -54,9 +54,14 @@ * Dean's [PATCH] ap_snprintf should be more sane (fwd) * Jim's/Ken's move of main/util_snprintf.c to ap/ap_snprintf.c * [PATCH] Re: [BUGFIXES] Wrong GID for PID file and UMASK for logs +* Dean's [PATCH] fix Rasmus' chunking error Available: +* [PATCH] PR#1366: fix result of send_fd_length + [EMAIL PROTECTED] + Status: Dean +1, Dirk +1 + * Jim's [PATCH] ap_cpystrn() function (replace strncpy) [EMAIL PROTECTED] Status: Jim +1 @@ -68,10 +73,6 @@ * Ken's [PATCH] for PR#1195 ( in realm names) [EMAIL PROTECTED] Status: Ken +1, Dean +1, Jim +1 - -* Dean's [PATCH] fix Rasmus' chunking error - [EMAIL PROTECTED] - Status: Dean +1, Rasmus +1, Jim +1 * Dean's [PATCH] mod_status cleanups [EMAIL PROTECTED] 1.544 +6 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.543 retrieving revision 1.544 diff -u -r1.543 -r1.544 --- CHANGES 1997/12/26 18:16:15 1.543 +++ CHANGES 1997/12/26 18:21:44 1.544 @@ -1,5 +1,11 @@ Changes with Apache 1.3b4 + *) The large_write() changes tickled a bug in bputc(), this would + show up as certain modules not working with Internet Explorer 4.0. + Fix this bug, and also fix a performance bug related to bputc() + causing a large_write() -- don't do large_write() unless there's + at least two bytes to write. [Dean Gaudet] + *) Move the gid switching code into the child so that log files and pid files are opened with the root gid. [Gregory A Lundberg [EMAIL PROTECTED]] 1.53 +13 -3 apachen/src/main/buff.c Index: buff.c === RCS file: /export/home/cvs/apachen/src/main/buff.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- buff.c1997/12/23 02:03:54 1.52 +++ buff.c1997/12/26 18:21:46 1.53 @@ -807,9 +807,16 @@ API_EXPORT(int) bflsbuf(int c, BUFF *fb) { char ss[1]; +int rc; ss[0] = c; -return bwrite(fb, ss, 1); +rc = bwrite(fb, ss, 1); +/* We do start_chunk() here so that the bputc macro can be smaller + * and faster + */ +if (rc == 1 (fb-flags B_CHUNK)) + start_chunk(fb); +return rc; } /* @@ -1056,9 +1063,12 @@ #ifndef NO_WRITEV /* * Detect case where we're asked to write a large buffer, and combine our - * current buffer with it in a single writev() + * current buffer with it in a single writev(). Note we don't consider + * the case nbyte == 1 because modules which use rputc() loops will cause + * us to use writev() too frequently. In those cases we really should just + * start a new buffer. */ -if (fb-outcnt 0 nbyte + fb-outcnt = fb-bufsiz) { +if (fb-outcnt 0 nbyte 1 nbyte + fb-outcnt = fb-bufsiz) { return large_write(fb, buf, nbyte); } #endif
cvs commit: apachen/src/main alloc.c
dgaudet 97/12/26 15:25:47 Modified:.STATUS src CHANGES src/main alloc.c Log: Interim (slow) fix for p-sub_pool critical sections in alloc.c. Affects win32 only. Submitted by: Ben Hyde Reviewed by: Dean Gaudet, Jim Jagielski Revision ChangesPath 1.35 +1 -9 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- STATUS1997/12/26 23:22:07 1.34 +++ STATUS1997/12/26 23:25:43 1.35 @@ -57,6 +57,7 @@ * Dean's [PATCH] fix Rasmus' chunking error * [PATCH] PR#1366: fix result of send_fd_length * Ben Hyde's [PATCH] Finish suite of mutex ops for non-threaded platforms +* Ben Hyde's [PATCH] Serialize the update to pool.sub_* in destroy_pool (take 2) Available: @@ -83,15 +84,6 @@ * Martin's [PATCH] 36kB: Make apache compile run on an EBCDIC mainframe [EMAIL PROTECTED] Status: Martin +1, Dean +1 - -* Ben Hyde's [PATCH] Serialize the update to pool.sub_* in destroy_pool - (take 2) - [EMAIL PROTECTED] - Status: Dean +1, Jim +1 - -* Dean's [PATCH] child_timeouts set wrong - [EMAIL PROTECTED] - Status: Jim +1, Dean +1 * Marc's [PATCH] PR#1543: suexec logging exec failures [EMAIL PROTECTED] 1.547 +3 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.546 retrieving revision 1.547 diff -u -r1.546 -r1.547 --- CHANGES 1997/12/26 23:22:09 1.546 +++ CHANGES 1997/12/26 23:25:44 1.547 @@ -1,4 +1,7 @@ Changes with Apache 1.3b4 + + *) Interim (slow) fix for p-sub_pool critical sections in + alloc.c (affects win32 only). [Ben Hyde] *) non-WIN32 was missing destroy_mutex definition. [Ben Hyde] 1.62 +9 -3 apachen/src/main/alloc.c Index: alloc.c === RCS file: /export/home/cvs/apachen/src/main/alloc.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -r1.61 -r1.62 --- alloc.c 1997/12/14 20:48:54 1.61 +++ alloc.c 1997/12/26 23:25:46 1.62 @@ -376,11 +376,13 @@ { block_alarms(); +(void) acquire_mutex(alloc_mutex); +{ while (a-sub_pools) destroy_pool(a-sub_pools); - -a-sub_pools = NULL; - +} +(void) release_mutex(alloc_mutex); +/* Don't hold the mutex during cleanups. */ run_cleanups(a-cleanups); a-cleanups = NULL; free_proc_chain(a-subprocesses); @@ -413,6 +415,8 @@ block_alarms(); clear_pool(a); +(void) acquire_mutex(alloc_mutex); +{ if (a-parent) { if (a-parent-sub_pools == a) a-parent-sub_pools = a-sub_next; @@ -421,6 +425,8 @@ if (a-sub_next) a-sub_next-sub_prev = a-sub_prev; } +} +(void) release_mutex(alloc_mutex); free_blocks(a-first); unblock_alarms();
cvs commit: apachen STATUS
dgaudet 97/12/26 15:36:27 Modified:.STATUS Log: foo Revision ChangesPath 1.36 +8 -2 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- STATUS1997/12/26 23:25:43 1.35 +++ STATUS1997/12/26 23:36:26 1.36 @@ -63,7 +63,7 @@ * Jim's [PATCH] ap_cpystrn() function (replace strncpy) Take II [EMAIL PROTECTED] - Status: Jim +1, Dirk +1, Marc wants to think about the name + Status: Jim +1, Dirk +1, Marc wants to think about the name, Dean +1 * [PATCH] mod_digest/1599: proxy authentication using the digest auth scheme never succeeds (fwd) [EMAIL PROTECTED] @@ -88,7 +88,7 @@ * Marc's [PATCH] PR#1543: suexec logging exec failures [EMAIL PROTECTED] Status: Marc +1, Dean +1, Jim +1, Martin +1 - + * Ben Hyde's [PATCH] WIN32 deserves a pid log file [EMAIL PROTECTED] Status: Jim +1 @@ -154,6 +154,12 @@ * Paul would like to see a 'gdbm' option because he uses it a lot. Dean notes that 'gdbm' include 'db' support so we need to watch the library ordering. + + Dean notes: Check rev 1.72 - rev 1.73 of + src/Configuration.tmpl. I re-ordered mod_auth_dbm and + mod_auth_db at this time, and I'm pretty sure it was to + deal with this issue. But I think I still ran into + troubles if I automatically looked for gdbm. * What do we call the binary: apache or httpd? Under UNIX it's httpd, under Win32 it's apache. Maybe rename it
cvs commit: apachen STATUS
dgaudet 97/12/30 10:43:06 Modified:.STATUS Log: foo Revision ChangesPath 1.41 +4 -0 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- STATUS1997/12/30 15:10:39 1.40 +++ STATUS1997/12/30 18:43:05 1.41 @@ -64,6 +64,10 @@ Available Patches: +* Dean's [PATCH] 1.3: DoS attack + [EMAIL PROTECTED] + Status: Dean +1 + * [PATCH] mod_digest/1599: proxy authentication using the digest auth scheme never succeeds (fwd) [EMAIL PROTECTED]
cvs commit: apachen/src/main util.c
dgaudet 97/12/30 11:55:50 Modified:src/main util.c Log: Fix some off-by-1s, and do some strength reduction from ap_cpystrn to memcpy. Revision ChangesPath 1.81 +6 -9 apachen/src/main/util.c Index: util.c === RCS file: /export/home/cvs/apachen/src/main/util.c,v retrieving revision 1.80 retrieving revision 1.81 diff -u -r1.80 -r1.81 --- util.c1997/12/30 19:03:18 1.80 +++ util.c1997/12/30 19:55:48 1.81 @@ -287,11 +287,8 @@ } else if (no nmatch pmatch[no].rm_so pmatch[no].rm_eo) { len = pmatch[no].rm_eo - pmatch[no].rm_so; - ap_cpystrn(dst, source + pmatch[no].rm_so, len); + memcpy(dst, source + pmatch[no].rm_so, len); dst += len; - /* is this still valid? jj 12/26/97 */ - if (*(dst - 1) == '\0') /* ap_cpystrn hit NULL. */ - return NULL; } } @@ -447,7 +444,7 @@ if (s[x] == '/') if ((++f) == n) { res = palloc(p, x + 2); - ap_cpystrn(res, s, x); + memcpy(res, s, x); res[x] = '/'; res[x + 1] = '\0'; return res; @@ -506,7 +503,7 @@ } res = palloc(atrans, pos + 1); -ap_cpystrn(res, *line, pos); +ap_cpystrn(res, *line, pos + 1); while ((*line)[pos] == stop) ++pos; @@ -540,7 +537,7 @@ } res = palloc(atrans, pos + 1); -ap_cpystrn(res, *line, pos); +ap_cpystrn(res, *line, pos + 1); while (isspace((*line)[pos])) ++pos; @@ -567,7 +564,7 @@ } res = palloc(atrans, pos + 1); -ap_cpystrn(res, *line, pos); +ap_cpystrn(res, *line, pos + 1); ++pos; @@ -850,7 +847,7 @@ tok_len = ptr - tok_start; token = palloc(p, tok_len + 1); -ap_cpystrn(token, tok_start, tok_len); +ap_cpystrn(token, tok_start, tok_len + 1); /* Advance accept_line pointer to the next non-white byte */
cvs commit: apachen/src/main alloc.c
dgaudet 97/12/30 11:56:12 Modified:src/main alloc.c Log: another off-by-1 Revision ChangesPath 1.65 +1 -1 apachen/src/main/alloc.c Index: alloc.c === RCS file: /export/home/cvs/apachen/src/main/alloc.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- alloc.c 1997/12/30 15:10:44 1.64 +++ alloc.c 1997/12/30 19:56:11 1.65 @@ -536,7 +536,7 @@ if (s == NULL) return NULL; res = palloc(a, n + 1); -ap_cpystrn(res, s, n); +ap_cpystrn(res, s, n + 1); return res; }
cvs commit: apachen/src/main http_request.c
dgaudet 97/12/31 13:39:27 Modified:src/main http_request.c Log: change comment Revision ChangesPath 1.96 +3 -3 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.95 retrieving revision 1.96 diff -u -r1.95 -r1.96 --- http_request.c1997/12/26 15:17:50 1.95 +++ http_request.c1997/12/31 21:39:26 1.96 @@ -447,9 +447,9 @@ } /* - * now match the special sections (regex, and proxy: stuff). But - * note that proxy: stuff doesn't get down this far, it's been handled - * earlier, so we'll just skip it. + * There's two types of IS_SPECIAL sections (see http_core.c), and we've + * already handled the proxy:-style stuff. Now we'll deal with the + * regexes. */ for (; j num_sec; ++j) { void *entry_config = sec[j];
cvs commit: apachen/src/modules/standard mod_info.c
dgaudet 98/01/02 15:44:46 Modified:.STATUS src CHANGES src/modules/standard mod_info.c Log: - make mod_info_html_cmd_string() thread safe - fix minor buffer overrun in mod_info_html_cmd_string() (it would only hammer a \0 up to 5 bytes past the end of the buffer... nothing big) - mod_info_load_config() switched to use getword_conf() just like the real config parsing routines - replace a bunch of ap_snprintf()/rputs() pairs with rprintf() for more efficiency Reviewed by: Brian Behlendorf Revision ChangesPath 1.45 +1 -4 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- STATUS1998/01/02 17:03:16 1.44 +++ STATUS1998/01/02 23:44:42 1.45 @@ -63,6 +63,7 @@ * Jim's [PATCH] ap_cpystrn() function (replace strncpy) Take II * Dean's [PATCH] 1.3: DoS attack * Paul/Ben's [PATCH] 1.3: spaces in NT spawn* arguments +* Dean's [PATCH] mod_info minor cleanups (take 2) Available Patches: @@ -79,10 +80,6 @@ * Dean's [PATCH] mod_status cleanups [EMAIL PROTECTED] Status: Dean +1, Jim +1 - -* Dean's [PATCH] mod_info minor cleanups (take 2) - [EMAIL PROTECTED] - Status: Dean +1, Brian +1 * Martin's [PATCH] 36kB: Make apache compile run on an EBCDIC mainframe [EMAIL PROTECTED] 1.554 +3 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.553 retrieving revision 1.554 diff -u -r1.553 -r1.554 --- CHANGES 1997/12/30 19:03:16 1.553 +++ CHANGES 1998/01/02 23:44:43 1.554 @@ -1,5 +1,8 @@ Changes with Apache 1.3b4 + *) A few cleanups in mod_info to make it thread-safe, and remove an + off-by-5 bug that could hammer \0 on the stack. [Dean Gaudet] + *) no2slash() was O(n^2) in the length of the input. Make it O(n). [Dean Gaudet] 1.32 +66 -105 apachen/src/modules/standard/mod_info.c Index: mod_info.c === RCS file: /export/home/cvs/apachen/src/modules/standard/mod_info.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- mod_info.c1997/10/26 20:20:05 1.31 +++ mod_info.c1998/01/02 23:44:45 1.32 @@ -119,27 +119,27 @@ return new; } -static char *mod_info_html_cmd_string(char *string) +static char *mod_info_html_cmd_string(const char *string, char *buf, size_t buf_len) { -char *s, *t; -static char ret[256]; /* What is the max size of a command? */ -char *end_ret; +const char *s; +char *t; +char *end_buf; -ret[0] = '\0'; s = string; -t = ret; -end_ret = t + sizeof(ret); -while ((*s) ((t - ret) sizeof(ret))) { +t = buf; +/* keep space for \0 byte */ +end_buf = buf + buf_len - 1; +while ((*s) (t end_buf)) { if (*s == '') { -strncpy(t, lt;, end_ret - t); +strncpy(t, lt;, end_buf - t); t += 4; } else if (*s == '') { -strncpy(t, gt;, end_ret - t); +strncpy(t, gt;, end_buf - t); t += 4; } else if (*s == '') { -strncpy(t, amp;, end_ret - t); +strncpy(t, amp;, end_buf - t); t += 5; } else { @@ -147,25 +147,33 @@ } s++; } -*t = '\0'; -return (ret); +/* oops, overflowed... don't overwrite */ +if (t end_buf) { + *end_buf = '\0'; +} +else { + *t = '\0'; +} +return (buf); } -static info_cfg_lines *mod_info_load_config(pool *p, char *filename, +static info_cfg_lines *mod_info_load_config(pool *p, const char *filename, request_rec *r) { char s[MAX_STRING_LEN]; configfile_t *fp; -info_cfg_lines *new, *ret = NULL, *prev = NULL; -char *t, *tt, o, *msg; +info_cfg_lines *new, *ret, *prev; +const char *t; fp = pcfg_openfile(p, filename); if (!fp) { -msg = pstrcat(r-pool, mod_info: couldn't open config file , - filename, NULL); -aplog_error(APLOG_MARK, APLOG_WARNING, r-server, msg); +aplog_error(APLOG_MARK, APLOG_WARNING, r-server, + mod_info: couldn't open config file %s, + filename); return NULL; } +ret = NULL; +prev = NULL; while (!cfg_getline
cvs commit: apachen/src/modules/standard mod_status.c
dgaudet 98/01/02 15:46:10 Modified:.STATUS src CHANGES src/modules/standard mod_status.c Log: - remove an unused buffer - mark a constant structure as const, and make it static, it's a waste to initialize it on every call - initialize the status flags once rather than on every call Reviewed by: Jim Jagielski Revision ChangesPath 1.46 +1 -4 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- STATUS1998/01/02 23:44:42 1.45 +++ STATUS1998/01/02 23:46:06 1.46 @@ -64,6 +64,7 @@ * Dean's [PATCH] 1.3: DoS attack * Paul/Ben's [PATCH] 1.3: spaces in NT spawn* arguments * Dean's [PATCH] mod_info minor cleanups (take 2) +* Dean's [PATCH] mod_status cleanups Available Patches: @@ -75,10 +76,6 @@ * [PATCH] mod_digest/1599: proxy authentication using the digest auth scheme never succeeds (fwd) [EMAIL PROTECTED] - Status: Dean +1, Jim +1 - -* Dean's [PATCH] mod_status cleanups - [EMAIL PROTECTED] Status: Dean +1, Jim +1 * Martin's [PATCH] 36kB: Make apache compile run on an EBCDIC mainframe 1.555 +2 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.554 retrieving revision 1.555 diff -u -r1.554 -r1.555 --- CHANGES 1998/01/02 23:44:43 1.554 +++ CHANGES 1998/01/02 23:46:07 1.555 @@ -1,5 +1,7 @@ Changes with Apache 1.3b4 + *) A few cleanups in mod_status for efficiency. [Dean Gaudet] + *) A few cleanups in mod_info to make it thread-safe, and remove an off-by-5 bug that could hammer \0 on the stack. [Dean Gaudet] 1.69 +35 -33apachen/src/modules/standard/mod_status.c Index: mod_status.c === RCS file: /export/home/cvs/apachen/src/modules/standard/mod_status.c,v retrieving revision 1.68 retrieving revision 1.69 diff -u -r1.68 -r1.69 --- mod_status.c 1997/12/20 10:21:59 1.68 +++ mod_status.c 1998/01/02 23:46:10 1.69 @@ -158,8 +158,6 @@ static void show_time(request_rec *r, time_t tsecs) { long days, hrs, mins, secs; -char buf[100]; -char *s; secs = tsecs % 60; tsecs /= 60; @@ -167,8 +165,6 @@ tsecs /= 60; hrs = tsecs % 24; days = tsecs / 24; -s = buf; -*s = '\0'; if (days) rprintf(r, %ld day%s, days, days == 1 ? : s); if (hrs) @@ -190,19 +186,22 @@ struct stat_opt { int id; -char *form_data_str; -char *hdr_out_str; +const char *form_data_str; +const char *hdr_out_str; }; +static const struct stat_opt status_options[] = /* see #defines above */ +{ +{STAT_OPT_REFRESH, refresh, Refresh}, +{STAT_OPT_NOTABLE, notable, NULL}, +{STAT_OPT_AUTO, auto, NULL}, +{STAT_OPT_END, NULL, NULL} +}; + +static char status_flags[SERVER_NUM_STATUS]; + static int status_handler(request_rec *r) { -struct stat_opt options[] = /* see #defines above */ -{ - {STAT_OPT_REFRESH, refresh, Refresh}, - {STAT_OPT_NOTABLE, notable, NULL}, - {STAT_OPT_AUTO, auto, NULL}, - {STAT_OPT_END, NULL, NULL} -}; char *loc; time_t nowtime = time(NULL); time_t up_time; @@ -228,22 +227,11 @@ server_rec *server = r-server; short_score score_record; parent_score ps_record; -char status[SERVER_NUM_STATUS]; char stat_buffer[HARD_SERVER_LIMIT]; clock_t tu, ts, tcu, tcs; tu = ts = tcu = tcs = 0; -status[SERVER_DEAD] = '.'; /* We don't want to assume these are in */ -status[SERVER_READY] = '_'; /* any particular order in scoreboard.h */ -status[SERVER_STARTING] = 'S'; -status[SERVER_BUSY_READ] = 'R'; -status[SERVER_BUSY_WRITE] = 'W'; -status[SERVER_BUSY_KEEPALIVE] = 'K'; -status[SERVER_BUSY_LOG] = 'L'; -status[SERVER_BUSY_DNS] = 'D'; -status[SERVER_GRACEFUL] = 'G'; - if (!exists_scoreboard_image()) { aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r-server, Server status unavailable in inetd mode); @@ -261,15 +249,15 @@ if (r-args) { i = 0; - while (options[i].id != STAT_OPT_END) { - if ((loc = strstr(r-args, options[i].form_data_str)) != NULL) { - switch (options[i].id) { + while (status_options[i].id != STAT_OPT_END) { + if ((loc = strstr(r-args, status_options[i
cvs commit: apachen/src/modules/standard mod_digest.c
dgaudet 98/01/02 15:58:29 Modified:.STATUS src CHANGES src/modules/standard mod_digest.c Log: Using the digest Authentication scheme for proxy authentication, authorization never succeeds because mod_digest always looks at the Authorization header, never at the Proxy-Authorization header. Also, the scheme in the auth header is compared to Digest using a case- sensitive comparison, instead of a case-insensitive comparison. PR: 1599 Submitted by: Ronald Tschalaer [EMAIL PROTECTED] Reviewed by: Dean Gaudet, Jim Jagielski Revision ChangesPath 1.47 +1 -5 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- STATUS1998/01/02 23:46:06 1.46 +++ STATUS1998/01/02 23:58:24 1.47 @@ -65,6 +65,7 @@ * Paul/Ben's [PATCH] 1.3: spaces in NT spawn* arguments * Dean's [PATCH] mod_info minor cleanups (take 2) * Dean's [PATCH] mod_status cleanups +* [PATCH] mod_digest/1599: proxy authentication using the digest auth scheme never succeeds (fwd) Available Patches: @@ -72,11 +73,6 @@ [EMAIL PROTECTED] Status: Ken +1, Jim +1 Gregory Lundberg says it's legally invalid - -* [PATCH] mod_digest/1599: proxy authentication using the digest auth - scheme never succeeds (fwd) - [EMAIL PROTECTED] - Status: Dean +1, Jim +1 * Martin's [PATCH] 36kB: Make apache compile run on an EBCDIC mainframe [EMAIL PROTECTED] 1.556 +4 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.555 retrieving revision 1.556 diff -u -r1.555 -r1.556 --- CHANGES 1998/01/02 23:46:07 1.555 +++ CHANGES 1998/01/02 23:58:26 1.556 @@ -1,5 +1,9 @@ Changes with Apache 1.3b4 + *) mod_digest didn't properly deal with proxy authentication. It + also lacked a case-insensitive comparision of the Digest + token. [Ronald Tschalaer [EMAIL PROTECTED]] PR#1599 + *) A few cleanups in mod_status for efficiency. [Dean Gaudet] *) A few cleanups in mod_info to make it thread-safe, and remove an 1.28 +4 -2 apachen/src/modules/standard/mod_digest.c Index: mod_digest.c === RCS file: /export/home/cvs/apachen/src/modules/standard/mod_digest.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- mod_digest.c 1997/12/18 20:39:18 1.27 +++ mod_digest.c 1998/01/02 23:58:28 1.28 @@ -132,7 +132,9 @@ int get_digest_rec(request_rec *r, digest_header_rec * response) { -const char *auth_line = table_get(r-headers_in, Authorization); +const char *auth_line = table_get(r-headers_in, +r-proxyreq ? Proxy-Authorization +: Authorization); int l; int s = 0, vk = 0, vv = 0; char *t, *key, *value; @@ -151,7 +153,7 @@ return AUTH_REQUIRED; } -if (strcmp(getword(r-pool, auth_line, ' '), Digest)) { +if (strcasecmp(getword(r-pool, auth_line, ' '), Digest)) { /* Client tried to authenticate using wrong auth scheme */ aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r-server, client used wrong authentication scheme: %s, r-uri);
cvs commit: apachen/src/modules/standard mod_alias.c mod_auth_anon.c mod_cern_meta.c mod_digest.c mod_log_agent.c mod_log_referer.c mod_usertrack.c
dgaudet 98/01/02 16:16:39 Modified:src/modules/standard mod_alias.c mod_auth_anon.c mod_cern_meta.c mod_digest.c mod_log_agent.c mod_log_referer.c mod_usertrack.c Log: Somehow I missed a whole boatload of modules when adding static. I'm not sure how that was. There's a few other changes in here, nothing that affects functionality, they're essentially documentation fixes. Revision ChangesPath 1.28 +3 -3 apachen/src/modules/standard/mod_alias.c Index: mod_alias.c === RCS file: /export/home/cvs/apachen/src/modules/standard/mod_alias.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- mod_alias.c 1997/12/14 20:48:55 1.27 +++ mod_alias.c 1998/01/03 00:16:35 1.28 @@ -246,10 +246,10 @@ {NULL} }; -static int alias_matches(char *uri, char *alias_fakename) +static int alias_matches(const char *uri, const char *alias_fakename) { -char *end_fakename = alias_fakename + strlen(alias_fakename); -char *aliasp = alias_fakename, *urip = uri; +const char *end_fakename = alias_fakename + strlen(alias_fakename); +const char *aliasp = alias_fakename, *urip = uri; while (aliasp end_fakename) { if (*aliasp == '/') { 1.28 +10 -10apachen/src/modules/standard/mod_auth_anon.c Index: mod_auth_anon.c === RCS file: /export/home/cvs/apachen/src/modules/standard/mod_auth_anon.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- mod_auth_anon.c 1997/10/22 20:30:15 1.27 +++ mod_auth_anon.c 1998/01/03 00:16:35 1.28 @@ -112,7 +112,7 @@ } anon_auth_config_rec; -void *create_anon_auth_dir_config(pool *p, char *d) +static void *create_anon_auth_dir_config(pool *p, char *d) { anon_auth_config_rec *sec = (anon_auth_config_rec *) pcalloc(p, sizeof(anon_auth_config_rec)); @@ -131,39 +131,39 @@ return sec; } -const char *anon_set_passwd_flag(cmd_parms *cmd, +static const char *anon_set_passwd_flag(cmd_parms *cmd, anon_auth_config_rec * sec, int arg) { sec-auth_anon_mustemail = arg; return NULL; } -const char *anon_set_userid_flag(cmd_parms *cmd, +static const char *anon_set_userid_flag(cmd_parms *cmd, anon_auth_config_rec * sec, int arg) { sec-auth_anon_nouserid = arg; return NULL; } -const char *anon_set_logemail_flag(cmd_parms *cmd, +static const char *anon_set_logemail_flag(cmd_parms *cmd, anon_auth_config_rec * sec, int arg) { sec-auth_anon_logemail = arg; return NULL; } -const char *anon_set_verifyemail_flag(cmd_parms *cmd, +static const char *anon_set_verifyemail_flag(cmd_parms *cmd, anon_auth_config_rec * sec, int arg) { sec-auth_anon_verifyemail = arg; return NULL; } -const char *anon_set_authoritative_flag(cmd_parms *cmd, +static const char *anon_set_authoritative_flag(cmd_parms *cmd, anon_auth_config_rec * sec, int arg) { sec-auth_anon_authoritative = arg; return NULL; } -const char *anon_set_string_slots(cmd_parms *cmd, +static const char *anon_set_string_slots(cmd_parms *cmd, anon_auth_config_rec * sec, char *arg) { @@ -187,7 +187,7 @@ return NULL; } -command_rec anon_auth_cmds[] = +static command_rec anon_auth_cmds[] = { {Anonymous, anon_set_string_slots, NULL, OR_AUTHCFG, ITERATE, a space-separated list of user IDs}, @@ -207,7 +207,7 @@ module MODULE_VAR_EXPORT anon_auth_module; -int anon_authenticate_basic_user(request_rec *r) +static int anon_authenticate_basic_user(request_rec *r) { anon_auth_config_rec *sec = (anon_auth_config_rec *) get_module_config(r-per_dir_config, @@ -267,7 +267,7 @@ return DECLINED; } -int check_anon_access(request_rec *r) +static int check_anon_access(request_rec *r) { #ifdef NOTYET conn_rec *c = r-connection; 1.23 +8 -8 apachen/src/modules/standard/mod_cern_meta.c Index: mod_cern_meta.c === RCS file: /export/home/cvs/apachen/src/modules/standard/mod_cern_meta.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- mod_cern_meta.c 1997/10/22 20:30:17 1.22 +++ mod_cern_meta.c 1998/01/03 00:16:36 1.23 @@ -166,7 +166,7 @@ char *metafiles; } cern_meta_dir_config; -void *create_cern_meta_dir_config(pool *p, char *dummy) +static void
cvs commit: apachen/src/main http_log.c
dgaudet 98/01/02 16:18:40 Modified:src CHANGES src/main http_log.c Log: Fix buffer overrun in log_printf(). Reviewed by: Randy Terbush Revision ChangesPath 1.557 +4 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.556 retrieving revision 1.557 diff -u -r1.556 -r1.557 --- CHANGES 1998/01/02 23:58:26 1.556 +++ CHANGES 1998/01/03 00:18:31 1.557 @@ -1,5 +1,9 @@ Changes with Apache 1.3b4 + *) The aplog_error changes specific to 1.3 introduced a buffer + overrun in the (now legacy) log_printf function. Fixed. + [Dean Gaudet] + *) mod_digest didn't properly deal with proxy authentication. It also lacked a case-insensitive comparision of the Digest token. [Ronald Tschalaer [EMAIL PROTECTED]] PR#1599 1.45 +1 -1 apachen/src/main/http_log.c Index: http_log.c === RCS file: /export/home/cvs/apachen/src/main/http_log.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- http_log.c1997/12/07 15:47:59 1.44 +++ http_log.c1998/01/03 00:18:38 1.45 @@ -413,7 +413,7 @@ va_list args; va_start(args, fmt); -vsprintf(buf, fmt, args); +ap_vsnprintf(buf, sizeof(buf), fmt, args); aplog_error(APLOG_MARK, APLOG_ERR, s, buf); va_end(args); }
cvs commit: apachen STATUS
dgaudet 98/01/05 10:45:55 Modified:.STATUS Log: update Revision ChangesPath 1.49 +13 -0 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- STATUS1998/01/05 08:47:10 1.48 +++ STATUS1998/01/05 18:45:54 1.49 @@ -70,6 +70,19 @@ Available Patches: +* Doug's httpd -MApache::httpd_conf + [EMAIL PROTECTED] + Status: Doug +1, Randy +1, Dean would really prefer Ben's proposal + of httpd -M config file directive if it works. + +* Martin's [PATCH] Location within .htaccess? + [EMAIL PROTECTED] + Status: Martin +1 + +* Brian Havard's [Patch] OS/2 - fix up shut down + [EMAIL PROTECTED] + Status: Dean +1 + * Ken's [PATCH] for copyright year update [EMAIL PROTECTED] Status: Ken +1, Jim +1
cvs commit: apachen STATUS
dgaudet 98/01/06 14:19:59 Modified:.STATUS Log: update Revision ChangesPath 1.50 +4 -0 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- STATUS1998/01/05 18:45:54 1.49 +++ STATUS1998/01/06 22:19:58 1.50 @@ -70,6 +70,10 @@ Available Patches: +* Dean's [PATCH] yet another slow function +[EMAIL PROTECTED] + Status: Dean +1 + * Doug's httpd -MApache::httpd_conf [EMAIL PROTECTED] Status: Doug +1, Randy +1, Dean would really prefer Ben's proposal
cvs commit: apache STATUS
dgaudet 98/01/06 14:43:57 Added: .Tag: APACHE_1_2_X STATUS Log: initial rev for 1.2 STATUS Revision ChangesPath No revision No revision 1.1.2.1 +145 -0apache/Attic/STATUS
cvs commit: apachen/src/modules/standard mod_imap.c
dgaudet 98/01/07 14:23:34 Modified:src/modules/standard mod_imap.c Log: This is a bit large, but that's deliberate because I took the opportunity to do the crap that we've been wanting done to mod_imap. - liberal use of const to help find stack assignments - remove all constant sized char arrays except input[]; replaced by pool string functions or by pointers into tokens inside the input[] array - in particular, the use of read_quoted() had a stack overrun potential. Eliminated. - These changes can chew memory when generating a menu. I don't care, I'd rather have them do that than have them overrun the stack. It shouldn't chew more than approx the size of the map file though. - better error handling Reviewed by: Jim Jagielski, Martin Kraemer Revision ChangesPath 1.37 +165 -153 apachen/src/modules/standard/mod_imap.c Index: mod_imap.c === RCS file: /export/home/cvs/apachen/src/modules/standard/mod_imap.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- mod_imap.c1998/01/07 16:46:50 1.36 +++ mod_imap.c1998/01/07 22:23:33 1.37 @@ -97,8 +97,6 @@ #include util_script.h #define IMAP_MAGIC_TYPE application/x-httpd-imap -#define LARGEBUF 500 -#define SMALLBUF 256 #define MAXVERTS 100 #define X 0 #define Y 1 @@ -159,7 +157,7 @@ {NULL} }; -static int pointinrect(double point[2], double coords[MAXVERTS][2]) +static int pointinrect(const double point[2], const double coords[MAXVERTS][2]) { double max[2], min[2]; if (coords[0][X] coords[1][X]) { @@ -184,7 +182,7 @@ (point[Y] = min[1] point[Y] = max[1])); } -static int pointincircle(double point[2], double coords[MAXVERTS][2]) +static int pointincircle(const double point[2], const double coords[MAXVERTS][2]) { double radius1, radius2; @@ -197,11 +195,12 @@ return (radius2 = radius1); } -static int pointinpoly(double point[2], double pgon[MAXVERTS][2]) +static int pointinpoly(const double point[2], const double pgon[MAXVERTS][2]) { int i, numverts, inside_flag, xflag0; int crossings; -double *p, *stop; +double *p; +const double *stop; double tx, ty, y; for (i = 0; pgon[i][X] != -1 i MAXVERTS; i++); @@ -271,7 +270,7 @@ } -static int is_closer(double point[2], double coords[MAXVERTS][2], double *closest) +static int is_closer(const double point[2], const double coords[MAXVERTS][2], double *closest) { double dist_squared = ((point[X] - coords[0][X]) * (point[X] - coords[0][X])) + ((point[Y] - coords[0][Y]) * (point[Y] - coords[0][Y])); @@ -289,7 +288,7 @@ } -static double get_x_coord(char *args) +static double get_x_coord(const char *args) { char *endptr; /* we want it non-null */ double x_coord = -1;/* -1 is returned if no coordinate is given */ @@ -308,7 +307,7 @@ return (-1);/* else if no conversion was made, or if no args was given */ } -static double get_y_coord(char *args) +static double get_y_coord(const char *args) { char *endptr; /* we want it non-null */ char *start_of_y = NULL; @@ -336,107 +335,98 @@ } -static int read_quoted(char *string, char *quoted_part) +/* See if string has a quoted part, and if so set *quoted_part to + * the first character of the quoted part, then hammer a \0 onto the + * trailing quote, and set *string to point at the first character + * past the second quote. + * + * Otherwise set *quoted_part to NULL, and leave *string alone. + */ +static void read_quoted(char **string, char **quoted_part) { -char *starting_pos = string; +char *strp = *string; -while (isspace(*string)) -string++; /* go along string until non-whitespace */ +/* assume there's no quoted part */ +*quoted_part = NULL; -if (*string == '') { /* if that character is a double quote */ +while (isspace(*strp)) +strp++; /* go along string until non-whitespace */ -string++; /* step over it */ +if (*strp == '') { /* if that character is a double quote */ +strp++; /* step over it */ + *quoted_part = strp;/* note where the quoted part begins */ -while (*string *string != '') { -*quoted_part++ = *string++; /* copy the quoted portion */ +while (*strp *strp != '') { + ++strp; /* skip the quoted portion */ } -*quoted_part = '\0';/* end the string with a SNUL */ +*strp = '\0
cvs commit: apachen/src/modules/standard mod_include.c
dgaudet 98/01/07 14:24:13 Modified:src/modules/standard mod_include.c Log: - There were a few strncpy()s that didn't terminate the string... add safe_copy() which does strncpy the way it should be. - switch many MAX_STRING_LENs with sizeof(foo) for the right foo, just in case - add const liberally to assist diagnosis - fix two off-by-1 errors in get_tag() (it could be convinced to hammer one byte past end of buffer) - fix buffer overrun in get_directive() - fix PR#1203 in a way that's fine for 1.2.x, but needs WIN32 support in 1.3 - test a few more error conditions and report them rather than doing something lame - buffer overrun and infinite loop in parse_string() eliminated - removed unneeded test of palloc() and make_sub_pool() results against NULL - fix use of strncat which didn't \0 terminate the destination - handle_else/handle_endif/handle_set/handle_printenv error messages didn't include the filename Reviewed by: Jim Jagielski, Martin Kraemer Revision ChangesPath 1.61 +220 -174 apachen/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /export/home/cvs/apachen/src/modules/standard/mod_include.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- mod_include.c 1998/01/07 16:46:50 1.60 +++ mod_include.c 1998/01/07 22:24:11 1.61 @@ -97,6 +97,12 @@ #define SIZEFMT_KMG 1 +static ap_inline void safe_copy(char *dest, const char *src, size_t max_len) +{ +strncpy(dest, src, max_len - 1); +dest[max_len - 1] = '\0'; +} + /* Environment function -- */ static void add_include_vars(request_rec *r, char *timefmt) @@ -196,7 +202,7 @@ c = (char)i; \ } -static int find_string(FILE *in, char *str, request_rec *r, int printing) +static int find_string(FILE *in, const char *str, request_rec *r, int printing) { int x, l = strlen(str), p; char outbuf[OUTBUFSIZE]; @@ -261,8 +267,8 @@ { int val, i, j; char *p = s; -char *ents; -static char *entlist[MAXENTLEN + 1] = +const char *ents; +static const char * const entlist[MAXENTLEN + 1] = { NULL, /* 0 */ NULL, /* 1 */ @@ -344,9 +350,9 @@ static char *get_tag(pool *p, FILE *in, char *tag, int tagbuf_len, int dodecode) { char *t = tag, *tag_val, c, term; -int n; -n = 0; +/* makes code below a little less cluttered */ +--tagbuf_len; do {/* skip whitespace */ GET_CHAR(in, c, NULL, p); @@ -360,8 +366,7 @@ GET_CHAR(in, c, NULL, p); } while (isspace(c)); if (c == '') { -strncpy(tag, done, tagbuf_len - 1); -tag[tagbuf_len - 1] = '\0'; +safe_copy(tag, done, tagbuf_len); return tag; } } @@ -370,8 +375,8 @@ /* find end of tag name */ while (1) { -if (++n == tagbuf_len) { -t[tagbuf_len - 1] = '\0'; +if (t - tag == tagbuf_len) { +*t = '\0'; return NULL; } if (c == '=' || isspace(c)) { @@ -404,8 +409,8 @@ term = c; while (1) { GET_CHAR(in, c, NULL, p); -if (++n == tagbuf_len) { -t[tagbuf_len - 1] = '\0'; +if (t - tag == tagbuf_len) { +*t = '\0'; return NULL; } /* Want to accept \ as a valid character within a string. */ @@ -428,10 +433,14 @@ return pstrdup(p, tag_val); } -static int get_directive(FILE *in, char *d, pool *p) +static int get_directive(FILE *in, char *dest, size_t len, pool *p) { +char *d = dest; char c; +/* make room for nul terminator */ +--len; + /* skip initial whitespace */ while (1) { GET_CHAR(in, c, 1, p); @@ -441,6 +450,9 @@ } /* now get directive */ while (1) { + if (d - dest == len) { + return 1; + } *d++ = tolower(c); GET_CHAR(in, c, 1, p); if (isspace(c)) { @@ -454,16 +466,24 @@ /* * Do variable substitution on strings */ -static void parse_string(request_rec *r, char *in, char *out, int length, - int leave_name) +static void parse_string(request_rec *r, const char *in, char *out, + size_t length, int leave_name) { char ch; char *next = out; -int numchars = 0; +char *end_out; + +/* leave room for nul terminator */ +end_out = out + length - 1; while ((ch = *in++) != '\0
cvs commit: apachen/src CHANGES
dgaudet 98/01/07 14:24:39 Modified:.STATUS src CHANGES Log: mod_include and mod_imap cleanup/security fixes Revision ChangesPath 1.57 +1 -4 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.56 retrieving revision 1.57 diff -u -r1.56 -r1.57 --- STATUS1998/01/07 17:04:02 1.56 +++ STATUS1998/01/07 22:24:36 1.57 @@ -70,12 +70,9 @@ scheme never succeeds (fwd) * Paul's [PATCH] a bundle of multithreading changes * Ken's [PATCH] for copyright year update +* Dean's [PATCH] 1.3: security updates for mod_imap and mod_include Available Patches: - -* Dean's [PATCH] 1.3: security updates for mod_imap and mod_include - [EMAIL PROTECTED] - Status: Dean +1, Jim +1, Martin +1 * Dean's [PATCH] yet another slow function [EMAIL PROTECTED] 1.559 +12 -5 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.558 retrieving revision 1.559 diff -u -r1.558 -r1.559 --- CHANGES 1998/01/05 08:41:22 1.558 +++ CHANGES 1998/01/07 22:24:37 1.559 @@ -1,5 +1,12 @@ Changes with Apache 1.3b4 + *) SECURITY: General mod_include cleanup, including fixing several + possible buffer overflows and a possible infinite loop. + [Dean Gaudet, Marc Slemko] + + *) SECURITY: Numerous changes to mod_imap in a general cleanup + including fixing a possible buffer overflow. [Dean Gaudet] + *) WIN32: overhaul of multithreading code. Shutdowns are now graceful (connections are not dropped). Code can handle graceful restarts (but there is as yet no way to signal this to Apache). Various @@ -537,11 +544,11 @@ update_mtime() routine has also been added to advance it if appropriate. [Roy Fielding, Ken Coar] - *) If a htaccess file can not be read due to bad permissions, deny - access to the directory with a HTTP_FORBIDDEN. The previous - behavior was to ignore the htaccess file if it could not - be read. This change may make some setups with unreadable - htaccess files stop working. PR#817 [Marc Slemko] + *) SECURITY: If a htaccess file can not be read due to bad permissions, + deny access to the directory with a HTTP_FORBIDDEN. The previous + behavior was to ignore the htaccess file if it could not be read. + This change may make some setups with unreadable htaccess files + stop working. PR#817 [Marc Slemko] *) Add aplog_error() providing a mechanism to define levels of verbosity to the server error logging. This addition also provides
cvs commit: apachen STATUS
dgaudet 98/01/07 14:26:49 Modified:.STATUS Log: is_only_below Revision ChangesPath 1.58 +2 -0 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.57 retrieving revision 1.58 diff -u -r1.57 -r1.58 --- STATUS1998/01/07 22:24:36 1.57 +++ STATUS1998/01/07 22:26:49 1.58 @@ -163,6 +163,8 @@ * Dean's locale project See [EMAIL PROTECTED] Status: Jim'll look into it + +* os_ abstract is_only_below() in mod_include.c Closed issues:
cvs commit: apachen/src/modules/standard mod_include.c
dgaudet 98/01/07 19:16:50 Modified:src/modules/standard mod_include.c Log: switch from safe_copy to ap_cpystrn Revision ChangesPath 1.62 +10 -16apachen/src/modules/standard/mod_include.c Index: mod_include.c === RCS file: /export/home/cvs/apachen/src/modules/standard/mod_include.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -r1.61 -r1.62 --- mod_include.c 1998/01/07 22:24:11 1.61 +++ mod_include.c 1998/01/08 03:16:48 1.62 @@ -97,12 +97,6 @@ #define SIZEFMT_KMG 1 -static ap_inline void safe_copy(char *dest, const char *src, size_t max_len) -{ -strncpy(dest, src, max_len - 1); -dest[max_len - 1] = '\0'; -} - /* Environment function -- */ static void add_include_vars(request_rec *r, char *timefmt) @@ -366,7 +360,7 @@ GET_CHAR(in, c, NULL, p); } while (isspace(c)); if (c == '') { -safe_copy(tag, done, tagbuf_len); +ap_cpystrn(tag, done, tagbuf_len); return tag; } } @@ -1574,7 +1568,7 @@ rputs( Evaluate string\n, r); #endif parse_string(r, current-token.value, buffer, sizeof(buffer), 0); - safe_copy(current-token.value, buffer, sizeof(current-token.value)); + ap_cpystrn(current-token.value, buffer, sizeof(current-token.value)); current-value = (current-token.value[0] != '\0'); current-done = 1; current = current-parent; @@ -1598,7 +1592,7 @@ case token_string: parse_string(r, current-left-token.value, buffer, sizeof(buffer), 0); -safe_copy(current-left-token.value, buffer, +ap_cpystrn(current-left-token.value, buffer, sizeof(current-left-token.value)); current-left-value = (current-left-token.value[0] != '\0'); current-left-done = 1; @@ -1613,7 +1607,7 @@ case token_string: parse_string(r, current-right-token.value, buffer, sizeof(buffer), 0); -safe_copy(current-right-token.value, buffer, +ap_cpystrn(current-right-token.value, buffer, sizeof(current-right-token.value)); current-right-value = (current-right-token.value[0] != '\0'); current-right-done = 1; @@ -1660,11 +1654,11 @@ } parse_string(r, current-left-token.value, buffer, sizeof(buffer), 0); -safe_copy(current-left-token.value, buffer, +ap_cpystrn(current-left-token.value, buffer, sizeof(current-left-token.value)); parse_string(r, current-right-token.value, buffer, sizeof(buffer), 0); -safe_copy(current-right-token.value, buffer, +ap_cpystrn(current-right-token.value, buffer, sizeof(current-right-token.value)); if (current-right-token.value[0] == '/') { int len; @@ -1725,11 +1719,11 @@ } parse_string(r, current-left-token.value, buffer, sizeof(buffer), 0); -safe_copy(current-left-token.value, buffer, +ap_cpystrn(current-left-token.value, buffer, sizeof(current-left-token.value)); parse_string(r, current-right-token.value, buffer, sizeof(buffer), 0); -safe_copy(current-right-token.value, buffer, +ap_cpystrn(current-right-token.value, buffer, sizeof(current-right-token.value)); #ifdef DEBUG_INCLUDE rvputs(r, Compare (, current-left-token.value, @@ -2056,8 +2050,8 @@ int printing; int conditional_status; -safe_copy(error, DEFAULT_ERROR_MSG, sizeof(error)); -safe_copy(timefmt, DEFAULT_TIME_FORMAT, sizeof(timefmt)); +ap_cpystrn(error, DEFAULT_ERROR_MSG, sizeof(error)); +ap_cpystrn(timefmt, DEFAULT_TIME_FORMAT, sizeof(timefmt)); sizefmt = SIZEFMT_KMG; /* Turn printing on */
cvs commit: apachen STATUS
dgaudet 98/01/07 19:18:22 Modified:.STATUS Log: make mod_include use ap_cpystrn Reviewed by: Brian Behlendorf, Jim Jagielski Revision ChangesPath 1.61 +1 -4 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- STATUS1998/01/08 02:37:23 1.60 +++ STATUS1998/01/08 03:18:22 1.61 @@ -71,16 +71,13 @@ * Paul's [PATCH] a bundle of multithreading changes * Ken's [PATCH] for copyright year update * Dean's [PATCH] 1.3: security updates for mod_imap and mod_include +* Dean's [PATCH] make mod_include use ap_cpystrn Available Patches: * Dean's [PATCH] make mod_rewrite use ap_cpystrn [EMAIL PROTECTED] Status: waiting to find out status of Ralf's mod_rewrite restructuring - -* Dean's [PATCH] make mod_include use ap_cpystrn - [EMAIL PROTECTED] - Status: Dean +1, Brian +1 * Dean's [PATCH] yet another slow function [EMAIL PROTECTED]
cvs commit: apache STATUS
dgaudet 98/01/08 13:20:07 Modified:.Tag: APACHE_1_2_X STATUS Log: some updates Revision ChangesPath No revision No revision 1.1.2.3 +8 -0 apache/Attic/STATUS Index: STATUS === RCS file: /export/home/cvs/apache/Attic/STATUS,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- STATUS1998/01/07 22:35:26 1.1.2.2 +++ STATUS1998/01/08 21:20:05 1.1.2.3 @@ -35,6 +35,14 @@ [EMAIL PROTECTED] Status: Mark +1, Dean +1 +* Martin's [PATCH]-1.2.6: passing escaped CC='$(CC)' (was: Re: STATUS: 1.2) + [EMAIL PROTECTED] + Status: Martin +1, Dean +1, Ken +1 + +* Martin's [PATCH]-1.2.6: avoid B_ERROR redeclaration (was: Re: STATUS: 1.2) + [EMAIL PROTECTED] + Status: Martin +1, Jim +1, Dean +1 + Needs patch: * Some fix for the bogus byte ranges bug.
cvs commit: apache/src CHANGES mod_usertrack.c
dgaudet 98/01/09 19:48:50 Modified:.Tag: APACHE_1_2_X STATUS src Tag: APACHE_1_2_X CHANGES mod_usertrack.c Log: Fix MPE porting problem. Submitted by: Mark Bixby Reviewed by: Dean Gaudet, Martin Kraemer Revision ChangesPath No revision No revision 1.1.2.6 +1 -4 apache/Attic/STATUS Index: STATUS === RCS file: /export/home/cvs/apache/Attic/STATUS,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- STATUS1998/01/09 15:49:39 1.1.2.5 +++ STATUS1998/01/10 03:48:47 1.1.2.6 @@ -7,6 +7,7 @@ * Martins portability change for ReliantUNIX/SINIX (_XPG_IV switch) * Martin's [PATCH]-1.2.6: passing escaped CC='$(CC)' * Martin's [PATCH]-1.2.6: avoid B_ERROR redeclaration +* Mark Bixby's MPE port patch Available: @@ -32,10 +33,6 @@ Status: Dean +1 * Marc's headers too big patch, repost it please? - -* Mark Bixby's MPE port patch - [EMAIL PROTECTED] - Status: Mark +1, Dean +1 Needs patch: No revision No revision 1.286.2.62 +8 -0 apache/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache/src/CHANGES,v retrieving revision 1.286.2.61 retrieving revision 1.286.2.62 diff -u -r1.286.2.61 -r1.286.2.62 --- CHANGES 1998/01/05 21:14:30 1.286.2.61 +++ CHANGES 1998/01/10 03:48:48 1.286.2.62 @@ -1,3 +1,11 @@ +Changes with Apache 1.2.6 + + *) Fix MPE compilation error in mod_usertrack.c. [Mark Bixby] + + *) Quote CC='$(CC)' to improve recurse make calls. [Martin Kraemer] + + *) Avoid B_ERROR redeclaration on sysvr4 systems. [Martin Kraemer] + Changes with Apache 1.2.5 *) SECURITY: Fix a possible buffer overflow in logresolve. This is 1.10.2.1 +2 -0 apache/src/mod_usertrack.c Index: mod_usertrack.c === RCS file: /export/home/cvs/apache/src/mod_usertrack.c,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -u -r1.10 -r1.10.2.1 --- mod_usertrack.c 1997/03/07 14:15:45 1.10 +++ mod_usertrack.c 1998/01/10 03:48:49 1.10.2.1 @@ -97,7 +97,9 @@ #include httpd.h #include http_config.h #include http_core.h +#ifndef MPE #include sys/time.h +#endif module usertrack_module;
cvs commit: apache STATUS
dgaudet 98/01/09 19:49:46 Modified:.Tag: APACHE_1_2_X STATUS Log: note that my backport bputc() fix helped Henrik Revision ChangesPath No revision No revision 1.1.2.7 +1 -0 apache/Attic/STATUS Index: STATUS === RCS file: /export/home/cvs/apache/Attic/STATUS,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -r1.1.2.6 -r1.1.2.7 --- STATUS1998/01/10 03:48:47 1.1.2.6 +++ STATUS1998/01/10 03:49:45 1.1.2.7 @@ -31,6 +31,7 @@ * Dean's backport of the bputc()/chunking bugfix. [EMAIL PROTECTED] Status: Dean +1 + This fix does fix Henrik's HTTP/1.1 chunking problem. * Marc's headers too big patch, repost it please?
cvs commit: apachen STATUS
dgaudet 98/01/10 00:25:25 Modified:.STATUS Log: yabba Revision ChangesPath 1.65 +4 -0 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- STATUS1998/01/10 05:48:52 1.64 +++ STATUS1998/01/10 08:25:24 1.65 @@ -77,6 +77,10 @@ Available Patches: +* Dean's [PATCH] OSF/1 serialized accept + [EMAIL PROTECTED] + Status: Dean +1 + * Dean's [PATCH] make mod_rewrite use ap_cpystrn [EMAIL PROTECTED] Status: waiting to find out status of Ralf's mod_rewrite restructuring
cvs commit: apachen/src/main .cvsignore
dgaudet 98/01/10 23:06:19 Modified:src/main .cvsignore Log: Since we don't symlink os.h and os-inline.h any longer we shouldn't .cvsignore them... I just ran into a bug in one of my old trees that I just cvs updated 'cause of an old copy of os.h. d'ohh. Revision ChangesPath 1.3 +0 -2 apachen/src/main/.cvsignore Index: .cvsignore === RCS file: /export/home/cvs/apachen/src/main/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- .cvsignore1997/09/12 20:14:19 1.2 +++ .cvsignore1998/01/11 07:06:18 1.3 @@ -1,3 +1 @@ Makefile -os.h -os-inline.c
cvs commit: apache-devsite index.html
dgaudet 98/01/12 12:34:29 Modified:.index.html Log: enough people have been confused Revision ChangesPath 1.13 +3 -4 apache-devsite/index.html Index: index.html === RCS file: /export/home/cvs/apache-devsite/index.html,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- index.html1997/12/20 16:06:44 1.12 +++ index.html1998/01/12 20:34:28 1.13 @@ -23,10 +23,9 @@ be waiting for someone to get around to updating them. /BLOCKQUOTE UL TYPE=SQUARE - LIDeveloper access to the -A - HREF=http://dev.apache.org/private/bugdb.cgi; -bug database/A + LIA href=http://bugs.apache.org/;Read-only/a, or +a href=http://bugs.apache.org/private/;read-write/a access to the +bug database. /LI LIArchives of the A
cvs commit: apache STATUS
dgaudet 98/01/12 22:26:39 Modified:.Tag: APACHE_1_2_X STATUS Log: it was raining earlier, 11C now Revision ChangesPath No revision No revision 1.1.2.8 +5 -1 apache/Attic/STATUS Index: STATUS === RCS file: /export/home/cvs/apache/Attic/STATUS,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -r1.1.2.7 -r1.1.2.8 --- STATUS1998/01/10 03:49:45 1.1.2.7 +++ STATUS1998/01/13 06:26:38 1.1.2.8 @@ -11,7 +11,6 @@ Available: - * Dean's mod_include_etag: PR#1133: mod_include shouldn't send ETag when XBitHack Full is set. @@ -34,6 +33,11 @@ This fix does fix Henrik's HTTP/1.1 chunking problem. * Marc's headers too big patch, repost it please? + +* backport of the netscape header padding fix, it's needed for 255 + as well as 256, 257 bytes + [EMAIL PROTECTED] + Status: Dean +1 Needs patch:
cvs commit: apachen STATUS
dgaudet 98/01/12 22:48:40 Modified:.STATUS Log: shorts are never appropriate for san francisco weather, except during the month of october Revision ChangesPath 1.79 +6 -2 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.78 retrieving revision 1.79 diff -u -r1.78 -r1.79 --- STATUS1998/01/13 06:41:29 1.78 +++ STATUS1998/01/13 06:48:38 1.79 @@ -86,7 +86,7 @@ * Marc's [PATCH] don't log bogus errno when file doesn't exist [EMAIL PROTECTED] - Status: + Status: Marc +1, Dean +1 * Dean's [PATCH] OSF/1 serialized accept [EMAIL PROTECTED] @@ -95,6 +95,8 @@ * Dean's [PATCH] make mod_rewrite use ap_cpystrn [EMAIL PROTECTED] Status: waiting to find out status of Ralf's mod_rewrite restructuring + Ralf says go for it now. + Status: Dean +1 * Dean's [PATCH] yet another slow function [EMAIL PROTECTED] @@ -107,11 +109,13 @@ * Martin's [PATCH] mod_speling [300] Multiple Choices bug (Take 2) Submitted by: Soeren Ziehe [EMAIL PROTECTED] [EMAIL PROTECTED] - Status: Martin +1, + Status: Martin +1, Dean +1 * Martin's [PATCH] 36kB: Make apache compile run on an EBCDIC mainframe [EMAIL PROTECTED] Status: Martin +1, Dean +1 + (needs an update I'm sure... I've been running this patch on a linux box + since Martin posted it without troubles -djg) * Marc's [PATCH] PR#1543: suexec logging exec failures [EMAIL PROTECTED]
cvs commit: apachen/src/main http_main.c
dgaudet 98/01/13 13:19:11 Modified:.STATUS src CHANGES src/main http_main.c Log: Brian says: This patch cleans up some problems with termination in OS/2. There are two issues fixed here: 1) Fixes the 'kill process tree' signal. Before this fix the children were only being killed after the first time out causing lots of warnings in the error log. 2) Allows a Ctrl-C to be used to cleanly shut down the server by a) Catching SIGINT and treating it like a SIGTERM b) Ensuring the SIGINT is sent to the parent process Submitted by: Brian Havard [EMAIL PROTECTED] Reviewed by: Dean Gaudet, Jim Jagielski Revision ChangesPath 1.81 +1 -4 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.80 retrieving revision 1.81 diff -u -r1.80 -r1.81 --- STATUS1998/01/13 16:20:35 1.80 +++ STATUS1998/01/13 21:19:06 1.81 @@ -77,6 +77,7 @@ * Doug's [PATCH] add -c and -C switches (take 3) * Paul's WIN32: patch to allow for Doug's -c option * Dean's [PATCH] unneeded pstrdup()s (in table_*() calls) +* Brian Havard's [Patch] OS/2 - fix up shut down Available Patches: @@ -101,10 +102,6 @@ * Dean's [PATCH] yet another slow function [EMAIL PROTECTED] Status: Dean +1, Jim +1, Martin +1, Paul +1 - -* Brian Havard's [Patch] OS/2 - fix up shut down - [EMAIL PROTECTED] - Status: Dean +1, Jim +1 * Martin's [PATCH] mod_speling [300] Multiple Choices bug (Take 2) Submitted by: Soeren Ziehe [EMAIL PROTECTED] 1.564 +4 -1 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.563 retrieving revision 1.564 diff -u -r1.563 -r1.564 --- CHANGES 1998/01/11 20:55:16 1.563 +++ CHANGES 1998/01/13 21:19:07 1.564 @@ -1,5 +1,8 @@ Changes with Apache 1.3b4 + *) PORT: Fix problem killing children when terminating. Allow ^C + to shut down the server. [Brian Havard] + *) pstrdup() is implicit in calls to table_* functions, so there's no need to do it before calling. Clean up a few cases. [Marc Slemko, Dean Gaudet] @@ -112,7 +115,7 @@ htdocs/manual/misc/known_client_problems.html#257th-byte) can happen at the 256th byte as well. Fixed. [Dean Gaudet] - *) Fix mod_mime_magic under OS/2, no support for block devices. + *) PORT: Fix mod_mime_magic under OS/2, no support for block devices. [Brian Havard] *) Fix memory corruption caused by allocating auth usernames in the 1.267 +16 -4 apachen/src/main/http_main.c Index: http_main.c === RCS file: /export/home/cvs/apachen/src/main/http_main.c,v retrieving revision 1.266 retrieving revision 1.267 diff -u -r1.266 -r1.267 --- http_main.c 1998/01/12 04:33:32 1.266 +++ http_main.c 1998/01/13 21:19:10 1.267 @@ -2223,6 +2223,10 @@ sa.sa_handler = sig_term; if (sigaction(SIGTERM, sa, NULL) 0) aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, sigaction(SIGTERM)); +#ifdef SIGINT +if (sigaction(SIGINT, sa, NULL) 0) +aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, sigaction(SIGINT)); +#endif /* we want to ignore HUPs and USR1 while we're busy processing one */ sigaddset(sa.sa_mask, SIGHUP); @@ -2263,11 +2267,11 @@ void detach(void) { -#if !defined(WIN32) !defined(__EMX__) +#if !defined(WIN32) int x; chdir(/); -#ifndef MPE +#if !defined(MPE) !defined(__EMX__) /* Don't detach for MPE because child processes can't survive the death of the parent. */ if ((x = fork()) 0) @@ -2293,7 +2297,7 @@ } #elif defined(__EMX__) /* OS/2 don't support process group IDs */ -pgrp = -getpid(); +pgrp = getpid(); #elif defined(MPE) /* MPE uses negative pid for process group */ pgrp = -getpid(); @@ -2323,7 +2327,7 @@ * but we haven't opened that yet. So leave it alone for now and it'll * be reopened moments later. */ -#endif /* ndef WIN32 or __EMX__ */ +#endif /* ndef WIN32 */ } /* Set group privileges. @@ -2906,6 +2910,14 @@ #endif signal(SIGPIPE, timeout); signal(SIGALRM, alrm_handler); + +#ifdef __EMX__ +/* Stop Ctrl-C/Ctrl-Break signals going to child processes */ +{ +unsigned long ulTimes; +DosSetSignalExceptionFocus(0, ulTimes); +} +#endif while (1) { BUFF *conn_io;
cvs commit: apachen STATUS
dgaudet 98/01/13 14:08:29 Modified:.STATUS Log: sunny blue skies at 8am, cloudy and overcast now Revision ChangesPath 1.82 +4 -0 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.81 retrieving revision 1.82 diff -u -r1.81 -r1.82 --- STATUS1998/01/13 21:19:06 1.81 +++ STATUS1998/01/13 22:08:27 1.82 @@ -81,6 +81,10 @@ Available Patches: +* Dean's [PATCH] protect the environment + [EMAIL PROTECTED] + Status: Dean +1 + * Dean's [PATCH] MONCONTROL for profiling children [EMAIL PROTECTED] Status: Dean +1
cvs commit: apachen/src/modules/standard mod_rewrite.c
dgaudet 98/01/13 14:21:09 Modified:.STATUS src/modules/standard mod_rewrite.c Log: make mod_rewrite use ap_cpystrn Reviewed by:Ralf Engelschall, Jim Jagielski Revision ChangesPath 1.83 +1 -6 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.82 retrieving revision 1.83 diff -u -r1.82 -r1.83 --- STATUS1998/01/13 22:08:27 1.82 +++ STATUS1998/01/13 22:21:06 1.83 @@ -78,6 +78,7 @@ * Paul's WIN32: patch to allow for Doug's -c option * Dean's [PATCH] unneeded pstrdup()s (in table_*() calls) * Brian Havard's [Patch] OS/2 - fix up shut down +* Dean's [PATCH] make mod_rewrite use ap_cpystrn Available Patches: @@ -96,12 +97,6 @@ * Dean's [PATCH] OSF/1 serialized accept [EMAIL PROTECTED] Status: Dean +1, Jim +1 (on code) - -* Dean's [PATCH] make mod_rewrite use ap_cpystrn - [EMAIL PROTECTED] - Status: waiting to find out status of Ralf's mod_rewrite restructuring - Ralf says go for it now. - Status: Dean +1, Jim +1 * Dean's [PATCH] yet another slow function [EMAIL PROTECTED] 1.60 +29 -51apachen/src/modules/standard/mod_rewrite.c Index: mod_rewrite.c === RCS file: /export/home/cvs/apachen/src/modules/standard/mod_rewrite.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -r1.59 -r1.60 --- mod_rewrite.c 1998/01/11 20:55:21 1.59 +++ mod_rewrite.c 1998/01/13 22:21:07 1.60 @@ -1090,11 +1090,9 @@ n = prefix_stat(r-filename, finfo); if (n == 0) { if ((cp = document_root(r)) != NULL) { -strncpy(docroot, cp, sizeof(docroot)-1); -EOS_PARANOIA(docroot); +l = ap_cpystrn(docroot, cp, sizeof(docroot)) - docroot; /* always NOT have a trailing slash */ -l = strlen(docroot); if (docroot[l-1] == '/') { docroot[l-1] = '\0'; } @@ -1714,8 +1712,7 @@ */ if (strcmp(output, -) == 0) { for (i = 0; p-env[i] != NULL; i++) { -strncpy(env, p-env[i], sizeof(env)-1); -EOS_PARANOIA(env); +ap_cpystrn(env, p-env[i], sizeof(env)); expand_backref_inbuffer(r-pool, env, sizeof(env), briRR, '$'); expand_backref_inbuffer(r-pool, env, sizeof(env), briRC, '%'); add_env_variable(r, env); @@ -1729,8 +1726,7 @@ * substitution URL string in `newuri'. */ /* 1. take the output string */ -strncpy(newuri, output, sizeof(newuri)-1); -EOS_PARANOIA(newuri); +ap_cpystrn(newuri, output, sizeof(newuri)); /* 2. expand $N (i.e. backrefs to RewriteRule pattern) */ expand_backref_inbuffer(r-pool, newuri, sizeof(newuri), briRR, '$'); /* 3. expand %N (i.e. backrefs to latest RewriteCond pattern) */ @@ -1751,8 +1747,7 @@ */ for (i = 0; p-env[i] != NULL; i++) { /* 1. take the string */ -strncpy(env, p-env[i], sizeof(env)-1); -EOS_PARANOIA(env); +ap_cpystrn(env, p-env[i], sizeof(env)); /* 2. expand $N (i.e. backrefs to RewriteRule pattern) */ expand_backref_inbuffer(r-pool, env, sizeof(env), briRR, '$'); /* 3. expand %N (i.e. backrefs to latest RewriteCond pattern) */ @@ -1913,8 +1908,7 @@ /* expand the regex backreferences from the RewriteRule ($0-$9), then from the last RewriteCond (%0-%9) and then expand the variables (%{}) */ -strncpy(input, p-input, sizeof(input)-1); -EOS_PARANOIA(input); +ap_cpystrn(input, p-input, sizeof(input)); expand_backref_inbuffer(r-pool, input, sizeof(input), briRR, '$'); expand_backref_inbuffer(r-pool, input, sizeof(input), briRC, '%'); expand_variables_inbuffer(r, input, sizeof(input)); @@ -2115,19 +2109,17 @@ /* cut the hostname and port out of the URI */ #ifdef APACHE_SSL -strncpy(buf, r-filename+strlen(http_method(r))+3, sizeof(buf)-1); +ap_cpystrn(buf, r-filename+strlen(http_method(r))+3, sizeof(buf)); #else -strncpy(buf, r-filename+7, sizeof(buf)-1); +ap_cpystrn(buf, r-filename+7, sizeof(buf)); #endif -EOS_PARANOIA(buf); hostp = buf; for (cp = hostp; *cp != '\0' *cp != '/' *cp != ':'; cp++) ; if (*cp == ':') { /* set host */ *cp++ = '\0'; -strncpy(host, hostp, sizeof(host)-1); -EOS_PARANOIA(host
cvs commit: apache/src CHANGES mod_rewrite.c
dgaudet 98/01/13 16:05:01 Modified:.Tag: APACHE_1_2_X STATUS src Tag: APACHE_1_2_X CHANGES mod_rewrite.c Log: fix %3f problem in mod_rewrite Submitted by: Ralf Engelschall Reviewed by: Dean Gaudet, Roy Fielding Revision ChangesPath No revision No revision 1.1.2.13 +1 -30 apache/Attic/STATUS Index: STATUS === RCS file: /export/home/cvs/apache/Attic/STATUS,v retrieving revision 1.1.2.12 retrieving revision 1.1.2.13 diff -u -r1.1.2.12 -r1.1.2.13 --- STATUS1998/01/14 00:02:52 1.1.2.12 +++ STATUS1998/01/14 00:04:56 1.1.2.13 @@ -10,6 +10,7 @@ * Mark Bixby's MPE port patch * more #define wrappers from FreeBSD port * Dean's backport of the bputc()/chunking bugfix. +* Ralf's mod_rewrite bugfix for %3f Available: @@ -21,10 +22,6 @@ Alternate solution already in 1.3. Needs update against new mod_include. -* Ralf's mod_rewrite bugfix for %3f - see below - Status: Ralf +1, Dean +1, Roy +1 - * Marc's headers too big patch, repost it please? * backport of the netscape header padding fix, it's needed for 255 @@ -37,29 +34,3 @@ * Some fix for the bogus byte ranges bug. * fix os_escape_path() - -Stuff from Ralf: - -* The following 1.2.5-adjusted bugfix for mod_rewrite.c - which fixes the Location: http://host/bar%3fquery; problem (the ? - is escaped but have not!) - -Index: mod_rewrite.c -=== -RCS file: /e/apache/REPOS/apache/src/mod_rewrite.c,v -retrieving revision 1.28.2.3 -diff -u -r1.28.2.3 mod_rewrite.c ---- mod_rewrite.c 1997/08/17 20:35:49 1.28.2.3 -+++ mod_rewrite.c 1997/10/28 11:53:52 -@@ -1590,6 +1590,7 @@ - } - rewritelog(r, 2, [per-dir %s] redirect %s - %s, perdir, r-filename, newuri); - r-filename = pstrdup(r-pool, newuri); -+splitout_queryargs(r, p-flags RULEFLAG_QSAPPEND); - r-status = p-forced_responsecode; - return 1; - } - - For 1.3 this bugfix is different and already replaced by the new patch - replacing the complete rewriting engine I'll post these days . - No revision No revision 1.286.2.65 +3 -0 apache/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache/src/CHANGES,v retrieving revision 1.286.2.64 retrieving revision 1.286.2.65 diff -u -r1.286.2.64 -r1.286.2.65 --- CHANGES 1998/01/14 00:02:55 1.286.2.64 +++ CHANGES 1998/01/14 00:04:58 1.286.2.65 @@ -1,5 +1,8 @@ Changes with Apache 1.2.6 + *) mod_rewrite would not handle %3f properly in some situations. + [Ralf Engelschall] + *) Apache could generate improperly chunked HTTP/1.1 responses when the bputc() or rputc() functions were used by modules (such as mod_include). [Dean Gaudet] 1.28.2.4 +1 -0 apache/src/mod_rewrite.c Index: mod_rewrite.c === RCS file: /export/home/cvs/apache/src/mod_rewrite.c,v retrieving revision 1.28.2.3 retrieving revision 1.28.2.4 diff -u -r1.28.2.3 -r1.28.2.4 --- mod_rewrite.c 1997/08/17 20:35:49 1.28.2.3 +++ mod_rewrite.c 1998/01/14 00:04:59 1.28.2.4 @@ -1590,6 +1590,7 @@ } rewritelog(r, 2, [per-dir %s] redirect %s - %s, perdir, r-filename, newuri); r-filename = pstrdup(r-pool, newuri); +splitout_queryargs(r, p-flags RULEFLAG_QSAPPEND); r-status = p-forced_responsecode; return 1; }
cvs commit: apachen/src/main http_protocol.c
dgaudet 98/01/19 16:07:23 Modified:.STATUS src CHANGES src/main http_protocol.c Log: basic auth token should be tested case-insensitive PR: 1666 Submitted by: [EMAIL PROTECTED] Reviewed by: Dean Gaudet, Martin Kraemer, Ken Coar Revision ChangesPath 1.98 +1 -0 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.97 retrieving revision 1.98 diff -u -r1.97 -r1.98 --- STATUS1998/01/18 10:36:57 1.97 +++ STATUS1998/01/20 00:07:18 1.98 @@ -87,6 +87,7 @@ * Martin's [PORT] Make apache compile run on an EBCDIC mainframe * Martin's [PATCH] mod_speling [300] Multiple Choices bug (Take 2) * Dean's [PATCH] protect the environment +* general/1666: Apache uses a case sensitive match for Basic auth scheme Available Patches: 1.567 +3 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.566 retrieving revision 1.567 diff -u -r1.566 -r1.567 --- CHANGES 1998/01/14 21:01:06 1.566 +++ CHANGES 1998/01/20 00:07:20 1.567 @@ -1,5 +1,8 @@ Changes with Apache 1.3b4 + *) basic auth needs a case-insensitive comparison. + [EMAIL PROTECTED] PR#1666 + *) For maximum portability, the environment passed to CGIs should only contain variables whose names match the regex /[a-zA-Z][a-zA-Z0-9_]*/. This is now enforced by stamping 1.175 +1 -1 apachen/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apachen/src/main/http_protocol.c,v retrieving revision 1.174 retrieving revision 1.175 diff -u -r1.174 -r1.175 --- http_protocol.c 1998/01/13 23:11:12 1.174 +++ http_protocol.c 1998/01/20 00:07:22 1.175 @@ -943,7 +943,7 @@ return AUTH_REQUIRED; } -if (strcmp(getword(r-pool, auth_line, ' '), Basic)) { +if (strcasecmp(getword(r-pool, auth_line, ' '), Basic)) { /* Client tried to authenticate using wrong auth scheme */ aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r-server, client used wrong authentication scheme: %s, r-uri);
cvs commit: apache/src CHANGES http_protocol.c
dgaudet 98/01/19 16:09:29 Modified:.Tag: APACHE_1_2_X STATUS src Tag: APACHE_1_2_X CHANGES http_protocol.c Log: test basic token with strcasecmp Submitted by: [EMAIL PROTECTED] Reviewed by: Dean Gaudet, Martin Kraemer, Ken Coar Revision ChangesPath No revision No revision 1.1.2.15 +1 -0 apache/Attic/STATUS Index: STATUS === RCS file: /export/home/cvs/apache/Attic/STATUS,v retrieving revision 1.1.2.14 retrieving revision 1.1.2.15 diff -u -r1.1.2.14 -r1.1.2.15 --- STATUS1998/01/14 00:09:30 1.1.2.14 +++ STATUS1998/01/20 00:09:22 1.1.2.15 @@ -12,6 +12,7 @@ * Dean's backport of the bputc()/chunking bugfix. * Ralf's mod_rewrite bugfix for %3f * backport of the netscape header padding fix +* general/1666: basic auth token should be tested case-insensitive Available: No revision No revision 1.286.2.67 +3 -0 apache/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache/src/CHANGES,v retrieving revision 1.286.2.66 retrieving revision 1.286.2.67 diff -u -r1.286.2.66 -r1.286.2.67 --- CHANGES 1998/01/14 00:09:32 1.286.2.66 +++ CHANGES 1998/01/20 00:09:23 1.286.2.67 @@ -1,5 +1,8 @@ Changes with Apache 1.2.6 + *) basic auth token should be tested case-insensitive. + [EMAIL PROTECTED] PR#1666 + *) It appears the 257th byte bug (see htdocs/manual/misc/known_client_problems.html#257th-byte) can happen at the 256th byte as well. Fixed. [Dean Gaudet] 1.126.2.8 +1 -1 apache/src/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache/src/http_protocol.c,v retrieving revision 1.126.2.7 retrieving revision 1.126.2.8 diff -u -r1.126.2.7 -r1.126.2.8 --- http_protocol.c 1998/01/14 00:09:33 1.126.2.7 +++ http_protocol.c 1998/01/20 00:09:25 1.126.2.8 @@ -927,7 +927,7 @@ return AUTH_REQUIRED; } -if (strcmp(getword (r-pool, auth_line, ' '), Basic)) { +if (strcasecmp(getword (r-pool, auth_line, ' '), Basic)) { /* Client tried to authenticate using wrong auth scheme */ log_reason (client used wrong authentication scheme, r-uri, r); note_basic_auth_failure (r);
cvs commit: apachen STATUS
dgaudet 98/01/19 16:12:35 Modified:.STATUS Log: yet another messed up sf day, raining then sunny then raining then sunny Revision ChangesPath 1.99 +7 -7 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.98 retrieving revision 1.99 diff -u -r1.98 -r1.99 --- STATUS1998/01/20 00:07:18 1.98 +++ STATUS1998/01/20 00:12:34 1.99 @@ -93,12 +93,12 @@ * Martin's [PATCH] Improve implementation of -c/-C directive reading (take 2) [EMAIL PROTECTED] - Status: Martin +1, Doug +1 + Status: Martin +1, Doug +1, Dean +1 * John Van Essen [EMAIL PROTECTED]'s fix for mod_autoindex PRE misplacement. [EMAIL PROTECTED] - Status: Ken +1 + Status: Ken +1, Dean +1 * Dean's [PATCH] MONCONTROL for profiling children [EMAIL PROTECTED] @@ -112,17 +112,13 @@ [EMAIL PROTECTED] Status: Dean +1, Jim +1 (on code) -* Dean's [PATCH] yet another slow function -[EMAIL PROTECTED] - Status: Dean +1, Jim +1, Martin +1, Paul +1 - * Marc's [PATCH] PR#1543: suexec logging exec failures [EMAIL PROTECTED] Status: Marc +1, Dean +1, Jim +1, Martin +1 * Ben Hyde's [PATCH] WIN32 deserves a pid log file [EMAIL PROTECTED] - Status: Jim +1, Martin +1 + Status: Jim +1, Martin +1, Dean +1 * M.D.Parker's [PATCH] mod_status/1448: Status Information have version [EMAIL PROTECTED] @@ -166,6 +162,10 @@ will post when it's at a state where he's happy with it. Ken would like to see it in libap instead of libmain. +* Dean's [PATCH] yet another slow function +[EMAIL PROTECTED] + Status: Dean +1, Jim +1, Martin +1, Paul +1 + Needs to be redone so that it better supports non-ascii hosts. Needs patch:
cvs commit: apachen STATUS
dgaudet 98/01/19 16:25:13 Modified:.STATUS Log: I disagree. This is a beta, and I'm tired of posting bloody one-line bug fix patches and waiting for votes. Sue me for wanting to improve the product using a minimum of my own time. Revision ChangesPath 1.100 +0 -5 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.99 retrieving revision 1.100 diff -u -r1.99 -r1.100 --- STATUS1998/01/20 00:12:34 1.99 +++ STATUS1998/01/20 00:25:13 1.100 @@ -9,11 +9,6 @@ 1.3b3: Released and announced 1.3b1: There is no 1.3b1 -Current Modes: - -o Review-Then-Commit -o NO lazy voting - Plan: Showstoppers:
cvs commit: apachen/src/main http_protocol.c
dgaudet 98/01/19 16:33:14 Modified:.STATUS src CHANGES src/main http_protocol.c Log: The Connection header could be sent back with multiple close tokens. Not an error, but a waste. PR: 1683 Submitted by: [EMAIL PROTECTED] Reviewed by: Dean Gaudet Revision ChangesPath 1.102 +1 -0 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.101 retrieving revision 1.102 diff -u -r1.101 -r1.102 --- STATUS1998/01/20 00:27:07 1.101 +++ STATUS1998/01/20 00:33:09 1.102 @@ -84,6 +84,7 @@ * Dean's [PATCH] protect the environment * general/1666: Apache uses a case sensitive match for Basic auth scheme * mod_rewrite/1684: RewriteLog directive does the equivalent of HostnameLookups on +* protocol/1683: The Connection header may contain multiple close tokens Available Patches: 1.569 +4 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.568 retrieving revision 1.569 diff -u -r1.568 -r1.569 --- CHANGES 1998/01/20 00:27:15 1.568 +++ CHANGES 1998/01/20 00:33:10 1.569 @@ -1,5 +1,9 @@ Changes with Apache 1.3b4 + *) The Connection header could be sent back with multiple close + tokens. Not an error, but a waste. + [EMAIL PROTECTED] PR#1683 + *) mod_rewrite's RewriteLog should behave like mod_log_config, it shouldn't force hostname lookups. [Dean Gaudet] PR#1684 1.176 +2 -1 apachen/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apachen/src/main/http_protocol.c,v retrieving revision 1.175 retrieving revision 1.176 diff -u -r1.175 -r1.176 --- http_protocol.c 1998/01/20 00:07:22 1.175 +++ http_protocol.c 1998/01/20 00:33:12 1.176 @@ -346,7 +346,8 @@ * as HTTP/1.0, but pass our request along with our HTTP/1.1 tag * to a HTTP/1.1 client. Better safe than sorry. */ -table_merge(r-headers_out, Connection, close); +if (!wimpy) + table_merge(r-headers_out, Connection, close); r-connection-keepalive = 0;
cvs commit: apache/src/modules/proxy proxy_ftp.c
dgaudet 98/01/19 16:49:39 Modified:.Tag: APACHE_1_2_X STATUS src Tag: APACHE_1_2_X CHANGES src/modules/proxy Tag: APACHE_1_2_X proxy_ftp.c Log: mod_proxy was sending HTTP/1.1 responses to ftp requests by mistake. Also removed the auto-generated link to www.apache.org that was the source of so many misdirected bug reports. (fixed in 1.3b1) Submitted by: Roy Fielding, Marc Slemko Reviewed by: Dean Gaudet Revision ChangesPath No revision No revision 1.1.2.17 +1 -0 apache/Attic/STATUS Index: STATUS === RCS file: /export/home/cvs/apache/Attic/STATUS,v retrieving revision 1.1.2.16 retrieving revision 1.1.2.17 diff -u -r1.1.2.16 -r1.1.2.17 --- STATUS1998/01/20 00:35:15 1.1.2.16 +++ STATUS1998/01/20 00:49:34 1.1.2.17 @@ -14,6 +14,7 @@ * backport of the netscape header padding fix * general/1666: basic auth token should be tested case-insensitive * protocol/1683: The Connection header may contain multiple close tokens +* proxy was sending HTTP/1.1 responses in error Available: No revision No revision 1.286.2.69 +4 -0 apache/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache/src/CHANGES,v retrieving revision 1.286.2.68 retrieving revision 1.286.2.69 diff -u -r1.286.2.68 -r1.286.2.69 --- CHANGES 1998/01/20 00:35:17 1.286.2.68 +++ CHANGES 1998/01/20 00:49:36 1.286.2.69 @@ -1,5 +1,9 @@ Changes with Apache 1.2.6 + *) mod_proxy was sending HTTP/1.1 responses to ftp requests by mistake. + Also removed the auto-generated link to www.apache.org that was the + source of so many misdirected bug reports. [Roy Fielding, Marc Slemko] + *) Multiple close tokens may have been set in the Connection header, not an error, but a waste. [EMAIL PROTECTED] PR#1683 No revision No revision 1.21.2.3 +6 -5 apache/src/modules/proxy/proxy_ftp.c Index: proxy_ftp.c === RCS file: /export/home/cvs/apache/src/modules/proxy/proxy_ftp.c,v retrieving revision 1.21.2.2 retrieving revision 1.21.2.3 diff -u -r1.21.2.2 -r1.21.2.3 --- proxy_ftp.c 1998/01/05 21:05:07 1.21.2.2 +++ proxy_ftp.c 1998/01/20 00:49:38 1.21.2.3 @@ -372,9 +372,10 @@ o+=w; } } -ap_snprintf(buf, sizeof(buf), /PREHRIA HREF=\http://www.apache.org\;%s/A/I/BODY/HTML, SERVER_VERSION); -bwrite(con-client, buf, strlen(buf)); -if (f2 != NULL) bwrite(f2, buf, strlen(buf)); +bputs(/PREHR/BODY/HTML\015\012, con-client); +if (f2 != NULL) { + bputs(/PREHR/BODY/HTML\015\012, f2); +} total_bytes_sent+=strlen(buf); bflush(con-client); @@ -944,9 +945,9 @@ /* send response */ /* write status line */ if (!r-assbackwards) - rvputs(r, SERVER_PROTOCOL, , r-status_line, \015\012, NULL); + rvputs(r, HTTP/1.0 , r-status_line, \015\012, NULL); if (cache != NULL) - if (bvputs(cache, SERVER_PROTOCOL, , r-status_line, \015\012, + if (bvputs(cache, HTTP/1.0 , r-status_line, \015\012, NULL) == -1) cache = proxy_cache_error(c);
cvs commit: apache/src CHANGES http_protocol.c
dgaudet 98/01/19 16:52:17 Modified:.Tag: APACHE_1_2_X STATUS src Tag: APACHE_1_2_X CHANGES http_protocol.c Log: r-connect-user allocated in wrong pool PR: 1500 Revision ChangesPath No revision No revision 1.1.2.18 +1 -0 apache/Attic/STATUS Index: STATUS === RCS file: /export/home/cvs/apache/Attic/STATUS,v retrieving revision 1.1.2.17 retrieving revision 1.1.2.18 diff -u -r1.1.2.17 -r1.1.2.18 --- STATUS1998/01/20 00:49:34 1.1.2.17 +++ STATUS1998/01/20 00:52:12 1.1.2.18 @@ -15,6 +15,7 @@ * general/1666: basic auth token should be tested case-insensitive * protocol/1683: The Connection header may contain multiple close tokens * proxy was sending HTTP/1.1 responses in error +* PR#1500: allocate r-connection-user in correct pool Available: No revision No revision 1.286.2.70 +3 -0 apache/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache/src/CHANGES,v retrieving revision 1.286.2.69 retrieving revision 1.286.2.70 diff -u -r1.286.2.69 -r1.286.2.70 --- CHANGES 1998/01/20 00:49:36 1.286.2.69 +++ CHANGES 1998/01/20 00:52:14 1.286.2.70 @@ -1,5 +1,8 @@ Changes with Apache 1.2.6 + *) r-connection-user was allocated in the wrong pool causing corruption + in some cases when used with mod_cern_meta. [Dean Gaudet] PR#1500 + *) mod_proxy was sending HTTP/1.1 responses to ftp requests by mistake. Also removed the auto-generated link to www.apache.org that was the source of so many misdirected bug reports. [Roy Fielding, Marc Slemko] 1.126.2.10 +1 -1 apache/src/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache/src/http_protocol.c,v retrieving revision 1.126.2.9 retrieving revision 1.126.2.10 diff -u -r1.126.2.9 -r1.126.2.10 --- http_protocol.c 1998/01/20 00:35:18 1.126.2.9 +++ http_protocol.c 1998/01/20 00:52:15 1.126.2.10 @@ -936,7 +936,7 @@ } t = uudecode (r-pool, auth_line); -r-connection-user = getword_nulls_nc (r-pool, t, ':'); +r-connection-user = getword_nulls_nc (r-connection-pool, t, ':'); r-connection-auth_type = Basic; *pw = t;
cvs commit: apachen/src/main util.c
dgaudet 98/01/19 17:42:24 Modified:src/main util.c Log: One of Marc's security patches that's in 1.2.5 but not 1.3. Submitted by: Marc Slemko Reviewed by: Dean Gaudet Revision ChangesPath 1.87 +6 -1 apachen/src/main/util.c Index: util.c === RCS file: /export/home/cvs/apachen/src/main/util.c,v retrieving revision 1.86 retrieving revision 1.87 diff -u -r1.86 -r1.87 --- util.c1998/01/19 15:08:39 1.86 +++ util.c1998/01/20 01:42:23 1.87 @@ -779,6 +779,11 @@ if (c == EOF) return 1; + + if(bufsize 2) { + /* too small, assume caller is crazy */ + return 1; + } while (1) { if ((c == '\t') || (c == ' ')) { @@ -793,7 +798,7 @@ /* increase line number and return on LF */ ++cfp-line_number; } - if (c == EOF || c == 0x4 || c == LF || i == (bufsize - 1)) { + if (c == EOF || c == 0x4 || c == LF || i = (bufsize - 2)) { /* blast trailing whitespace */ while (i 0 isspace(buf[i - 1])) --i;
cvs commit: apachen STATUS
dgaudet 98/01/19 17:54:03 Modified:.STATUS Log: note win32 buffer overflow possibilities Revision ChangesPath 1.105 +3 -0 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.104 retrieving revision 1.105 diff -u -r1.104 -r1.105 --- STATUS1998/01/20 01:50:40 1.104 +++ STATUS1998/01/20 01:54:02 1.105 @@ -274,6 +274,9 @@ Help: +* numerous uses of strcpy and strcat have potential for buffer + overflow, someone should rewrite or verify they're safe + * process/thread model - need dynamic thread creation/destruction, similar to Unix process model
cvs commit: apachen/src/support htdigest.c htpasswd.c
dgaudet 98/01/19 17:55:26 Modified:src/support htdigest.c htpasswd.c Log: Note these two aren't setuid safe. Revision ChangesPath 1.13 +6 -0 apachen/src/support/htdigest.c Index: htdigest.c === RCS file: /export/home/cvs/apachen/src/support/htdigest.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- htdigest.c1997/10/12 06:00:47 1.12 +++ htdigest.c1998/01/20 01:55:25 1.13 @@ -1,3 +1,9 @@ +/** + ** + * NOTE! This program is not safe as a setuid executable! Do not make it + * setuid! + ** + */ /* * htdigest.c: simple program for manipulating digest passwd file for Apache * 1.9 +6 -0 apachen/src/support/htpasswd.c Index: htpasswd.c === RCS file: /export/home/cvs/apachen/src/support/htpasswd.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- htpasswd.c1997/10/12 06:00:47 1.8 +++ htpasswd.c1998/01/20 01:55:25 1.9 @@ -1,3 +1,9 @@ +/** + ** + * NOTE! This program is not safe as a setuid executable! Do not make it + * setuid! + ** + */ /* * htpasswd.c: simple program for manipulating password file for NCSA httpd *
cvs commit: apachen STATUS
dgaudet 98/01/19 18:25:14 Modified:.STATUS Log: YADoS Revision ChangesPath 1.106 +3 -0 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.105 retrieving revision 1.106 diff -u -r1.105 -r1.106 --- STATUS1998/01/20 01:54:02 1.105 +++ STATUS1998/01/20 02:25:13 1.106 @@ -180,6 +180,9 @@ * proxy security fixes from 1.2.5 need to be brought forward +* DoS created by the lame hostname lookup code in check_fulluri, which + should be part of the proxy and not in the core + Closed issues: * Removal of inetd mode
cvs commit: apachen/src/main conf.h
dgaudet 98/01/21 13:59:30 Modified:src CHANGES src/main conf.h Log: NeXT cc pretends to be gcc but it really isn't. Work around it's inaneness. PR: 1613 Revision ChangesPath 1.575 +5 -1 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.574 retrieving revision 1.575 diff -u -r1.574 -r1.575 --- CHANGES 1998/01/21 21:54:26 1.574 +++ CHANGES 1998/01/21 21:59:27 1.575 @@ -1,7 +1,11 @@ Changes with Apache 1.3b4 + *) The NeXT cc (which is gcc hacked up) doesn't appear to support some + gcc functionality. Work around it. + [Keith Severson [EMAIL PROTECTED]] PR#1613 + *) Some linkers complain when .o files contain no functions. - [Dean Gaudet] PR#1614 + [Keith Severson [EMAIL PROTECTED]] PR#1614 *) Some const declarations in mod_imap.c that were added for debugging purposes caused some compilers heartburn without adding any 1.169 +7 -1 apachen/src/main/conf.h Index: conf.h === RCS file: /export/home/cvs/apachen/src/main/conf.h,v retrieving revision 1.168 retrieving revision 1.169 diff -u -r1.168 -r1.169 --- conf.h1998/01/21 19:17:36 1.168 +++ conf.h1998/01/21 21:59:29 1.169 @@ -730,8 +730,14 @@ * GNUC attributes (such as to get -Wall warnings for printf-like * functions). Only do this in gcc 2.7 or later ... it may work * on earlier stuff, but why chance it. + * + * We've since discovered that the gcc shipped with NeXT systems + * as cc is completely broken. It claims to be __GNUC__ and so + * on, but it doesn't implement half of the things that __GNUC__ + * means. In particular it's missing inline and the __attribute__ + * stuff. So we hack around it. PR#1613. -djg */ -#if !defined(__GNUC__) || __GNUC__ 2 || __GNUC_MINOR__ 7 +#if !defined(__GNUC__) || __GNUC__ 2 || __GNUC_MINOR__ 7 || defined(NEXT) #define ap_inline #define __attribute__(__x) #else
cvs commit: apachen/src/modules/proxy proxy_ftp.c
dgaudet 98/01/21 14:02:40 Modified:src/modules/proxy proxy_ftp.c Log: clean up some warnings. An unused function, and an extra parm to ap_snprintf(). Revision ChangesPath 1.46 +1 -21 apachen/src/modules/proxy/proxy_ftp.c Index: proxy_ftp.c === RCS file: /export/home/cvs/apachen/src/modules/proxy/proxy_ftp.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- proxy_ftp.c 1998/01/07 16:46:37 1.45 +++ proxy_ftp.c 1998/01/21 22:02:39 1.46 @@ -214,26 +214,6 @@ return status; } -static char * - encode_space(request_rec *r, char *path) -{ -char *newpath; -int i, j, len; - -len = strlen(path); -newpath = palloc(r-pool, 3 * len + 1); -for (i = 0, j = 0; i len; i++, j++) { - if (path[i] != ' ') - newpath[j] = path[i]; - else { - proxy_c2hex(' ', newpath[j]); - j += 2; - } -} -newpath[j] = '\0'; -return newpath; -} - static long int send_dir(BUFF *f, request_rec *r, BUFF *f2, struct cache_req *c, char *url) { char buf[IOBUFSIZE]; @@ -287,7 +267,7 @@ BASE HREF=\%s%s\/HEAD\n BODYH2Directory of A HREF=\/\%s/A/, - tempurl, psite, path, site, site); + tempurl, psite, path, site); bputs(buf, con-client); if (f2 != NULL) bputs(buf, f2);
cvs commit: apachen/src/support htdigest.c htpasswd.c
dgaudet 98/01/21 14:05:46 Modified:src CHANGES src/support htdigest.c htpasswd.c Log: Tweaks to use copy instead of cp under win32 and os2. PR: 1482 Submitted by: Brian Havard Revision ChangesPath 1.576 +3 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.575 retrieving revision 1.576 diff -u -r1.575 -r1.576 --- CHANGES 1998/01/21 21:59:27 1.575 +++ CHANGES 1998/01/21 22:05:43 1.576 @@ -1,5 +1,8 @@ Changes with Apache 1.3b4 + *) htdigest and htpasswd needed slight tweaks to work on OS/2 and WIN32. + [Brian Havard] + *) The NeXT cc (which is gcc hacked up) doesn't appear to support some gcc functionality. Work around it. [Keith Severson [EMAIL PROTECTED]] PR#1613 1.14 +4 -0 apachen/src/support/htdigest.c Index: htdigest.c === RCS file: /export/home/cvs/apachen/src/support/htdigest.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- htdigest.c1998/01/20 01:55:25 1.13 +++ htdigest.c1998/01/21 22:05:45 1.14 @@ -200,7 +200,11 @@ } fclose(f); fclose(tfp); +#if defined(__EMX__) || defined(WIN32) +sprintf(command, copy \%s\ \%s\, tn, argv[1]); +#else sprintf(command, cp %s %s, tn, argv[1]); +#endif system(command); unlink(tn); exit(0); 1.10 +4 -0 apachen/src/support/htpasswd.c Index: htpasswd.c === RCS file: /export/home/cvs/apachen/src/support/htpasswd.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- htpasswd.c1998/01/20 01:55:25 1.9 +++ htpasswd.c1998/01/21 22:05:45 1.10 @@ -215,7 +215,11 @@ } fclose(f); fclose(tfp); +#if defined(__EMX__) || defined(WIN32) +sprintf(command, copy \%s\ \%s\, tn, argv[1]); +#else sprintf(command, cp %s %s, tn, argv[1]); +#endif system(command); unlink(tn); exit(0);
cvs commit: apachen STATUS
dgaudet 98/01/21 14:07:35 Modified:.STATUS Log: I'm not sure how the day is doing, my blinds are closed Revision ChangesPath 1.111 +3 -0 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.110 retrieving revision 1.111 diff -u -r1.110 -r1.111 --- STATUS1998/01/21 19:06:09 1.110 +++ STATUS1998/01/21 22:07:34 1.111 @@ -97,6 +97,9 @@ * Ken's addition of src/ap/ap.h for prototypes of routines in libap.a * Ken's addition of #ifndef wrappers to src/main/*.h header files * Ken's removal of problem-causing consts from mod_imap.c +* os-next/1613: can't compile +* os-next/1614: can't compile +* os-os2/1482: I cannot add a user in an existing password file Available Patches:
cvs commit: apachen/src/modules/proxy mod_proxy.c
dgaudet 98/01/21 14:09:58 Modified:src/modules/proxy mod_proxy.c Log: more const stuff from debugging the code Revision ChangesPath 1.31 +3 -3 apachen/src/modules/proxy/mod_proxy.c Index: mod_proxy.c === RCS file: /export/home/cvs/apachen/src/modules/proxy/mod_proxy.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- mod_proxy.c 1998/01/07 16:46:34 1.30 +++ mod_proxy.c 1998/01/21 22:09:57 1.31 @@ -82,10 +82,10 @@ /* -- */ /* Translate the URL into a 'filename' */ -static int alias_match(char *uri, char *alias_fakename) +static int alias_match(const char *uri, const char *alias_fakename) { -char *end_fakename = alias_fakename + strlen(alias_fakename); -char *aliasp = alias_fakename, *urip = uri; +const char *end_fakename = alias_fakename + strlen(alias_fakename); +const char *aliasp = alias_fakename, *urip = uri; while (aliasp end_fakename) { if (*aliasp == '/') {
cvs commit: apachen/src/main http_config.c util.c
dgaudet 98/01/21 14:11:04 Modified:src CHANGES src/main http_config.c util.c Log: Clean up the -C/-c implementation. Submitted by: Martin Kraemer Reviewed by: Dean Gaudet, Doug MacEachern, Jim Jagielski Revision ChangesPath 1.577 +1 -1 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.576 retrieving revision 1.577 diff -u -r1.576 -r1.577 --- CHANGES 1998/01/21 22:05:43 1.576 +++ CHANGES 1998/01/21 22:10:59 1.577 @@ -78,7 +78,7 @@ -c directive : process directive after reading config files example: httpd -C PerlModule Apache::httpd_conf - [Doug MacEachern] + [Doug MacEachern, Martin Kraemer] *) WIN32: Fix the execution of CGIs that are scripts and called with path info that does not have an '=' in. 1.94 +54 -21apachen/src/main/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apachen/src/main/http_config.c,v retrieving revision 1.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- http_config.c 1998/01/13 23:11:09 1.93 +++ http_config.c 1998/01/21 22:11:01 1.94 @@ -908,40 +908,73 @@ return make_full_path(p, server_root, file); } + +/* This structure and the following functions are needed for the + * table-based config file reading. They are passed to the + * cfg_open_custom() routine. + */ + +/* Structure to be passed to cfg_open_custom(): it contains an + * index which is incremented from 0 to nelts on each call to + * cfg_getline() (which in turn calls arr_elts_getstr()) + * and an array_header pointer for the string array. + */ +typedef struct { +array_header *array; +int curr_idx; +} arr_elts_param_t; + + +/* arr_elts_getstr() returns the next line from the string array. */ +static void *arr_elts_getstr(void *buf, size_t bufsiz, void *param) +{ +arr_elts_param_t *arr_param = (arr_elts_param_t *) param; + +/* End of array reached? */ +if (++arr_param-curr_idx arr_param-array-nelts) +return NULL; + +/* return the line */ +ap_cpystrn(buf, ((char **) arr_param-array-elts)[arr_param-curr_idx - 1], bufsiz); + +return buf; +} + + +/* arr_elts_close(): dummy close routine (makes sure no more lines can be read) */ +static int arr_elts_close(void *param) +{ +arr_elts_param_t *arr_param = (arr_elts_param_t *) param; +arr_param-curr_idx = arr_param-array-nelts; +return 0; +} + void process_command_config(server_rec *s, array_header *arr, pool *p, pool *ptemp) { const char *errmsg; cmd_parms parms; -int i; -char **lines = (char **)arr-elts; +arr_elts_param_t arr_parms; + +arr_parms.curr_idx = 0; +arr_parms.array = arr; parms = default_parms; parms.pool = p; parms.temp_pool = ptemp; parms.server = s; parms.override = (RSRC_CONF | OR_ALL) ~(OR_AUTHCFG | OR_LIMIT); -parms.config_file = pcfg_openfile(p, NULL); +parms.config_file = pcfg_open_custom(p, -c/-C directives, + arr_parms, NULL, + arr_elts_getstr, arr_elts_close); -for (i = 0; i arr-nelts; ++i) { - char *line = lines[i]; +errmsg = srm_command_loop(parms, s-lookup_defaults); -#ifdef MOD_PERL - if(!(strncmp(line, PerlModule , 11))) { - const char *perl_cmd_module(cmd_parms *parms, void *dummy, char *arg); - line += 11; - (void)perl_cmd_module(parms, s-lookup_defaults, line); - continue; - } -#endif - - errmsg = handle_command(parms, s-lookup_defaults, line); - - if (errmsg) { - fprintf(stderr, Syntax error in command: `%s'\n, lines[i]); - fprintf(stderr, %s\n, errmsg); - exit(1); - } +if (errmsg) { +fprintf(stderr, Syntax error in -C/-c directive:\n%s\n, errmsg); +exit(1); } + +cfg_closefile(parms.config_file); } void process_resource_config(server_rec *s, char *fname, pool *p, pool *ptemp) 1.89 +33 -16apachen/src/main/util.c Index: util.c === RCS file: /export/home/cvs/apachen/src/main/util.c,v retrieving revision 1.88 retrieving revision 1.89 diff -u -r1.88 -r1.89 --- util.c1998/01/20 01:48:47 1.88 +++ util.c1998/01/21 22:11:02 1.89 @@ -674,26 +674,43 @@ { configfile_t *new_cfg; FILE *file; +#ifdef unvoted_DISALLOW_DEVICE_ACCESS +struct stat stbuf; +#endif + +if (name == NULL
cvs commit: apachen STATUS
dgaudet 98/01/21 14:11:31 Modified:.STATUS Log: yadda Revision ChangesPath 1.112 +2 -5 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.111 retrieving revision 1.112 diff -u -r1.111 -r1.112 --- STATUS1998/01/21 22:07:34 1.111 +++ STATUS1998/01/21 22:11:31 1.112 @@ -100,13 +100,10 @@ * os-next/1613: can't compile * os-next/1614: can't compile * os-os2/1482: I cannot add a user in an existing password file - -Available Patches: - * Martin's [PATCH] Improve implementation of -c/-C directive reading (take 2) - [EMAIL PROTECTED] - Status: Martin +1, Doug +1, Dean +1, Jim +1 + +Available Patches: * Dean's [PATCH] MONCONTROL for profiling children [EMAIL PROTECTED]
cvs commit: apachen/src/support suexec.c
dgaudet 98/01/21 14:22:10 Modified:src CHANGES src/support suexec.c Log: add errno to suexec error messages PR: 1543 Submitted by: Marc Slemko Reviewed by: Dean Gaudet, Martin Kraemer, Jim Jagielski Revision ChangesPath 1.581 +2 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.580 retrieving revision 1.581 diff -u -r1.580 -r1.581 --- CHANGES 1998/01/21 22:18:58 1.580 +++ CHANGES 1998/01/21 22:22:07 1.581 @@ -1,5 +1,7 @@ Changes with Apache 1.3b4 + *) suexec errors now include the errno/description. [Marc Slemko] PR#1543 + *) PORT: OSF/1 now uses USE_FLOCK_SERIALIZED_ACCEPT to solve PR#467. The choice of flock vs. fcntl was made based on timings which showed that even on non-NFS, non-exported filesystems fcntl() was an order of 1.32 +11 -9 apachen/src/support/suexec.c Index: suexec.c === RCS file: /export/home/cvs/apachen/src/support/suexec.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- suexec.c 1998/01/07 16:47:14 1.31 +++ suexec.c 1998/01/21 22:22:09 1.32 @@ -68,19 +68,21 @@ */ -#include suexec.h - #include sys/param.h -#include stdlib.h -#include unistd.h +#include sys/stat.h #include sys/types.h -#include stdio.h + +#include errno.h +#include grp.h +#include pwd.h #include stdarg.h +#include stdio.h +#include stdlib.h #include string.h -#include pwd.h -#include grp.h #include time.h -#include sys/stat.h +#include unistd.h + +#include suexec.h /* *** @@ -499,6 +501,6 @@ * * Oh well, log the failure and error out. */ -log_err(exec failed (%s)\n, cmd); +log_err((%d)%s: exec failed (%s)\n, errno, strerror(errno), cmd); exit(255); }
cvs commit: apachen/src/main http_main.c
dgaudet 98/01/21 14:24:06 Modified:src CHANGES src/main http_main.c Log: WIN32 deserves a pid file. Submitted by: Ben Hyde Reviewed by: Jim Jagielski, Martin Kraemer, Dean Gaudet Revision ChangesPath 1.582 +2 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.581 retrieving revision 1.582 diff -u -r1.581 -r1.582 --- CHANGES 1998/01/21 22:22:07 1.581 +++ CHANGES 1998/01/21 22:24:00 1.582 @@ -1,4 +1,6 @@ Changes with Apache 1.3b4 + + *) WIN32 deserves a pid file. [Ben Hyde] *) suexec errors now include the errno/description. [Marc Slemko] PR#1543 1.270 +1 -0 apachen/src/main/http_main.c Index: http_main.c === RCS file: /export/home/cvs/apachen/src/main/http_main.c,v retrieving revision 1.269 retrieving revision 1.270 diff -u -r1.269 -r1.270 --- http_main.c 1998/01/21 22:14:14 1.269 +++ http_main.c 1998/01/21 22:24:04 1.270 @@ -4860,6 +4860,7 @@ } server_conf = read_config(pconf, ptrans, server_confname); +log_pid(pconf, pid_fname); init_modules(pconf, server_conf); suexec_enabled = init_suexec(); open_logs(server_conf, pconf);
cvs commit: apachen/src/main util_script.c
dgaudet 98/01/21 14:31:47 Modified:src CHANGES src/main util_script.c Log: Let people shoot themselves by passing Authorization to CGIs if they define SECURITY_HOLE_PASS_AUTHORIZATION. PR: 549 Submitted by: Marc Slemko Reviewed by: Dean Gaudet, Paul Sutton Revision ChangesPath 1.584 +4 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.583 retrieving revision 1.584 diff -u -r1.583 -r1.584 --- CHANGES 1998/01/21 22:27:17 1.583 +++ CHANGES 1998/01/21 22:31:44 1.584 @@ -1,5 +1,9 @@ Changes with Apache 1.3b4 + *) If you define SECURITY_HOLE_PASS_AUTHORIZATION then the Authorization + header will be passed to CGIs. This is generally a security hole, so + it's not a default. [Marc Slemko] PR#549 + *) Fix Y2K problem with date printing in suexec log. [Paul Eggert [EMAIL PROTECTED]] PR#1343 1.92 +7 -0 apachen/src/main/util_script.c Index: util_script.c === RCS file: /export/home/cvs/apachen/src/main/util_script.c,v retrieving revision 1.91 retrieving revision 1.92 diff -u -r1.91 -r1.92 --- util_script.c 1998/01/14 21:01:08 1.91 +++ util_script.c 1998/01/21 22:31:46 1.92 @@ -208,8 +208,15 @@ table_set(e, CONTENT_TYPE, hdrs[i].val); else if (!strcasecmp(hdrs[i].key, Content-length)) table_set(e, CONTENT_LENGTH, hdrs[i].val); + /* + * You really don't want to disable this check, since it leaves you + * wide open to CGIs stealing passwords and people viewing them + * in the environment with ps -e. But, if you must... + */ +#ifndef SECURITY_HOLE_PASS_AUTHORIZATION else if (!strcasecmp(hdrs[i].key, Authorization)) continue; +#endif else table_set(e, http2env(r-pool, hdrs[i].key), hdrs[i].val); }
cvs commit: apachen/src/main http_request.c
dgaudet 98/01/21 14:48:14 Modified:src CHANGES src/main http_request.c Log: We need to eat the request body, if any, in die() in order to continue a keep-alive session. PR: 1399 Submitted by: Roy Fielding Reviewed by: Martin Kraemer, Dean Gaudet Revision ChangesPath 1.585 +5 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.584 retrieving revision 1.585 diff -u -r1.584 -r1.585 --- CHANGES 1998/01/21 22:31:44 1.584 +++ CHANGES 1998/01/21 22:48:10 1.585 @@ -1,5 +1,10 @@ Changes with Apache 1.3b4 + *) When die() happens we need to eat any request body if one exists. + Otherwise we can't continue with a keepalive session. This shows up + as a POST problem with MSIE 4.0, typically against pages which are + authenticated. [Roy Fielding] PR#1399 + *) If you define SECURITY_HOLE_PASS_AUTHORIZATION then the Authorization header will be passed to CGIs. This is generally a security hole, so it's not a default. [Marc Slemko] PR#549 1.100 +11 -0 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.99 retrieving revision 1.100 diff -u -r1.99 -r1.100 --- http_request.c1998/01/11 20:55:18 1.99 +++ http_request.c1998/01/21 22:48:13 1.100 @@ -878,6 +878,17 @@ } /* + * If we want to keep the connection, be sure that the request body + * (if any) has been read. + */ +if ((r-status != HTTP_NOT_MODIFIED) (r-status != HTTP_NO_CONTENT) + !status_drops_connection(r-status) + r-connection (r-connection-keepalive != -1)) { + +(void) discard_request_body(r); +} + +/* * Two types of custom redirects --- plain text, and URLs. Plain text has * a leading '', so the URL code, here, is triggered on its absence */
cvs commit: apachen STATUS
dgaudet 98/01/21 14:56:23 Modified:.STATUS Log: this space intentionally left blank Revision ChangesPath 1.114 +1 -4 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.113 retrieving revision 1.114 diff -u -r1.113 -r1.114 --- STATUS1998/01/21 22:32:50 1.113 +++ STATUS1998/01/21 22:56:23 1.114 @@ -109,6 +109,7 @@ * Ben Hyde's [PATCH] WIN32 deserves a pid log file * Paul Eggert's [PATCH] suexec/1343: year-2000 bug in suexec log * Marc's [PATCH] define to allow passing of Authorization header +* Roy's [PATCH] protocol/1399: failing to read body Available Patches: @@ -116,10 +117,6 @@ * M.D.Parker's [PATCH] mod_status/1448: Status Information have version [EMAIL PROTECTED] Status: Dean +1, Martin +1, Alexei -1 (shared lib concerns) - -* Roy's [PATCH] protocol/1399: failing to read body - [EMAIL PROTECTED] - Status: Roy +1, Martin +1 (on code) * Martin's [PATCH] Signing server generated pages [EMAIL PROTECTED]
cvs commit: apachen/src/main conf.h
dgaudet 98/01/21 15:49:08 Modified:src CHANGES src/main conf.h Log: Unixware smp requires accept serialization. PR: 1553 Revision ChangesPath 1.587 +4 -1 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.586 retrieving revision 1.587 diff -u -r1.586 -r1.587 --- CHANGES 1998/01/21 23:12:02 1.586 +++ CHANGES 1998/01/21 23:49:02 1.587 @@ -1,6 +1,9 @@ Changes with Apache 1.3b4 - *) [PORT] A/UX can handle single-listen accepts without mutex + *) PORT: UnixWare 2.1.2 SMP appears to require USE_FCNTL_SERIALIZED_ACCEPT. + It should be safe on all versions. [Dean Gaudet] PR#1553 + + *) PORT: A/UX can handle single-listen accepts without mutex locking, so we add SAFE_UNSERIALIZED_ACCEPT. [Jim Jagielski] *) When die() happens we need to eat any request body if one exists. 1.172 +1 -0 apachen/src/main/conf.h Index: conf.h === RCS file: /export/home/cvs/apachen/src/main/conf.h,v retrieving revision 1.171 retrieving revision 1.172 diff -u -r1.171 -r1.172 --- conf.h1998/01/21 23:12:08 1.171 +++ conf.h1998/01/21 23:49:06 1.172 @@ -475,6 +475,7 @@ #define _POSIX_SOURCE #define NET_SIZE_T size_t #define HAVE_SYSLOG +#define USE_FCNTL_SERIALIZED_ACCEPT #elif defined(DGUX) #define NO_KILLPG
cvs commit: apachen/src/main conf.h http_main.c
dgaudet 98/01/21 16:00:00 Modified:src CHANGES Configure src/main conf.h http_main.c Log: Found a great cleanup patch for unixware in PR#1282. Applied it with slight modifications. This should cleanup SIGHUP, serialized accept problems, and enable syslog support. PR: 1082, 1282, 1499, 1553 Submitted by: Tom Hughes [EMAIL PROTECTED] Revision ChangesPath 1.588 +5 -2 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.587 retrieving revision 1.588 diff -u -r1.587 -r1.588 --- CHANGES 1998/01/21 23:49:02 1.587 +++ CHANGES 1998/01/21 23:59:52 1.588 @@ -1,7 +1,10 @@ Changes with Apache 1.3b4 - *) PORT: UnixWare 2.1.2 SMP appears to require USE_FCNTL_SERIALIZED_ACCEPT. - It should be safe on all versions. [Dean Gaudet] PR#1553 + *) PORT: UnixWare 2.1.2 SMP appears to require USE_FCNTL_SERIALIZED_ACCEPT, + as do various earlier versions. It should be safe on all versions. + Unixware 1.x appears to have the same SIGHUP bug as solaris does with + the slack code. A few other cleanups for Unixware. + [Tom Hughes [EMAIL PROTECTED]] PR#1082, PR#1282, PR#1499, PR#1553 *) PORT: A/UX can handle single-listen accepts without mutex locking, so we add SAFE_UNSERIALIZED_ACCEPT. [Jim Jagielski] 1.178 +4 -4 apachen/src/Configure Index: Configure === RCS file: /export/home/cvs/apachen/src/Configure,v retrieving revision 1.177 retrieving revision 1.178 diff -u -r1.177 -r1.178 --- Configure 1998/01/21 17:12:34 1.177 +++ Configure 1998/01/21 23:59:54 1.178 @@ -428,23 +428,23 @@ *-unixware1) DEF_WANTHSREGEX=yes OS='Unixware' - CFLAGS=$CFLAGS -DSVR4 -DNO_LINGCLOSE + CFLAGS=$CFLAGS -DUW=100 LIBS=$LIBS -lsocket -lnsl -lcrypt ;; *-unixware2) DEF_WANTHSREGEX=yes OS='Unixware' - CFLAGS=$CFLAGS -DSVR4 -DNO_LINGCLOSE + CFLAGS=$CFLAGS -DUW=200 LIBS=$LIBS -lsocket -lnsl -lcrypt -lgen ;; *-unixware211) OS='Unixware 2.1.1' - CFLAGS=$CFLAGS -DUW + CFLAGS=$CFLAGS -DUW=211 LIBS=$LIBS -lsocket -lnsl -lcrypt -lgen ;; *-unixware212) OS='Unixware 2.1.2' - CFLAGS=$CFLAGS -DUW + CFLAGS=$CFLAGS -DUW=212 LIBS=$LIBS -lsocket -lnsl -lcrypt -lgen DBM_LIB= ;; 1.173 +2 -0 apachen/src/main/conf.h Index: conf.h === RCS file: /export/home/cvs/apachen/src/main/conf.h,v retrieving revision 1.172 retrieving revision 1.173 diff -u -r1.172 -r1.173 --- conf.h1998/01/21 23:49:06 1.172 +++ conf.h1998/01/21 23:59:56 1.173 @@ -472,7 +472,9 @@ #define HAVE_SYS_SELECT_H #define HAVE_SYS_RESOURCE_H #include sys/time.h +#if UW = 200 #define _POSIX_SOURCE +#endif #define NET_SIZE_T size_t #define HAVE_SYSLOG #define USE_FCNTL_SERIALIZED_ACCEPT 1.271 +5 -0 apachen/src/main/http_main.c Index: http_main.c === RCS file: /export/home/cvs/apachen/src/main/http_main.c,v retrieving revision 1.270 retrieving revision 1.271 diff -u -r1.270 -r1.271 --- http_main.c 1998/01/21 22:24:04 1.270 +++ http_main.c 1998/01/21 23:59:58 1.271 @@ -2499,6 +2499,11 @@ #define WORKAROUND_SOLARIS_BUG #endif +/* PR#1282 Unixware 1.x appears to have the same problem as solaris */ +#if defined (UW) UW 200 +#define WORKAROUND_SOLARIS_BUG +#endif + #ifndef WORKAROUND_SOLARIS_BUG s = ap_slack(s, AP_SLACK_HIGH);
cvs commit: apachen STATUS
dgaudet 98/01/21 16:03:38 Modified:.STATUS Log: uwfoo Revision ChangesPath 1.115 +1 -0 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.114 retrieving revision 1.115 diff -u -r1.114 -r1.115 --- STATUS1998/01/21 22:56:23 1.114 +++ STATUS1998/01/22 00:03:37 1.115 @@ -110,6 +110,7 @@ * Paul Eggert's [PATCH] suexec/1343: year-2000 bug in suexec log * Marc's [PATCH] define to allow passing of Authorization header * Roy's [PATCH] protocol/1399: failing to read body +* PR#1082, 1282, 1499, 1553: unixware cleanup Available Patches:
cvs commit: apachen/htdocs/manual/misc known_client_problems.html
dgaudet 98/01/22 12:37:49 Modified:htdocs/manual/misc known_client_problems.html Log: document no-content-length and gif89-expires Revision ChangesPath 1.5 +19 -0 apachen/htdocs/manual/misc/known_client_problems.html Index: known_client_problems.html === RCS file: /export/home/cvs/apachen/htdocs/manual/misc/known_client_problems.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- known_client_problems.html1997/12/21 08:18:13 1.4 +++ known_client_problems.html1998/01/22 20:37:48 1.5 @@ -194,6 +194,25 @@ headers returned by a CGI, Apache will explicitly avoid merging any codeSet-Cookie/code headers. +a name=gif89-expiresh3codeExpires/code headers and GIF89A animations/h3/a + +pNavigator versions 2 through 4 will erroneously re-request +GIF89A animations on each loop of the animation if the first +response included an codeExpires/code header. This happens +regardless of how far in the future the expiry time is set. There +is no workaround supplied with Apache, however there are hacks for a +href=http://www.arctic.org/~dgaudet/patches/apache-1.2-gif89-expires-hack.patch;1.2/a +and for a +href=http://www.arctic.org/~dgaudet/patches/apache-1.3-gif89-expires-hack.patch;1.3/a. + +a name=no-content-lengthh3codePOST/code without codeContent-Length/code/h3/a + +pIn certain situations Navigator 3 appears to incorrectly +issue a POST without the request body. There is no +known workaround. There's a little more information a +href=http://www.arctic.org/~dgaudet/apache/no-content-length/; +available/a. + !--#include virtual=footer.html -- /BODY /HTML
cvs commit: apachen/src/main buff.c
dgaudet 98/01/22 13:00:07 Modified:src/main buff.c Log: document doerror() a little better Submitted by: Ben Hyde Reviewed by: Dean Gaudet Revision ChangesPath 1.58 +3 -6 apachen/src/main/buff.c Index: buff.c === RCS file: /export/home/cvs/apachen/src/main/buff.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -r1.57 -r1.58 --- buff.c1998/01/16 14:22:54 1.57 +++ buff.c1998/01/22 21:00:06 1.58 @@ -247,16 +247,13 @@ return rv; } -static void doerror(BUFF *fb, int err) +static void doerror(BUFF *fb, int direction) { int errsave = errno; /* Save errno to prevent overwriting it below */ -if (err == B_RD) - fb-flags |= B_RDERR; -else - fb-flags |= B_WRERR; +fb-flags |= (direction == B_RD ? B_RDERR : B_WRERR); if (fb-error != NULL) - (*fb-error) (fb, err, fb-error_data); + (*fb-error) (fb, direction, fb-error_data); errno = errsave; }
cvs commit: apachen/htdocs/manual/mod core.html
dgaudet 98/01/22 15:18:59 Modified:htdocs/manual/misc FAQ.html htdocs/manual/mod core.html Log: Support users with older versions of the server. Revision ChangesPath 1.98 +3 -2 apachen/htdocs/manual/misc/FAQ.html Index: FAQ.html === RCS file: /export/home/cvs/apachen/htdocs/manual/misc/FAQ.html,v retrieving revision 1.97 retrieving revision 1.98 diff -u -r1.97 -r1.98 --- FAQ.html 1998/01/22 23:11:48 1.97 +++ FAQ.html 1998/01/22 23:18:56 1.98 @@ -15,7 +15,7 @@ !--#include virtual=header.html -- H1 ALIGN=CENTERApache Server Frequently Asked Questions/H1 P - $Revision: 1.97 $ ($Date: 1998/01/22 23:11:48 $) + $Revision: 1.98 $ ($Date: 1998/01/22 23:18:56 $) /P P The latest version of this FAQ is always available from the main @@ -1805,7 +1805,8 @@ As a last-resort workaround, you can comment out the CODE#define USE_SHMGET_SCOREBOARD/CODE definition in the SAMPLINUX/SAMP section of - SAMPsrc/conf.h/SAMP and rebuild the server. This will produce + SAMPsrc/conf.h/SAMP and rebuild the server (prior to 1.3b4 the + definition was named CODE#define HAVE_SHMGET/CODE). This will produce a server which is slower and less reliable. /P HR 1.90 +2 -2 apachen/htdocs/manual/mod/core.html Index: core.html === RCS file: /export/home/cvs/apachen/htdocs/manual/mod/core.html,v retrieving revision 1.89 retrieving revision 1.90 diff -u -r1.89 -r1.90 --- core.html 1998/01/22 23:11:51 1.89 +++ core.html 1998/01/22 23:18:58 1.90 @@ -1480,12 +1480,12 @@ Linux 1.x users might be able to add code-DUSE_SHMGET_SCOREBOARD/code to the codeEXTRA_CFLAGS/code in your codeConfiguration/code. This might work with some 1.x installations, but won't work with all of -them.p +them. (Prior to 1.3b4 this define was named codeHAVE_SHMGET/code.)p SVR4 users should consider adding code-DUSE_SHMGET_SCOREBOARD/code to the codeEXTRA_CFLAGS/code in your codeConfiguration/code. This is believed to work, but we were unable to test it in time for 1.2 -release.p +release. (Prior to 1.3b4 this define was named codeHAVE_SHMGET/code.)p strongSee Also/strong: a href=../stopping.htmlStopping and Restarting Apache/a/p
cvs commit: apachen/src CHANGES
dgaudet 98/01/22 15:22:14 Modified:src CHANGES Log: I'm sure some folks rely on these tokens... and would like to know they changed Revision ChangesPath 1.590 +10 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.589 retrieving revision 1.590 diff -u -r1.589 -r1.590 --- CHANGES 1998/01/22 23:11:53 1.589 +++ CHANGES 1998/01/22 23:22:10 1.590 @@ -1,5 +1,15 @@ Changes with Apache 1.3b4 + *) For clarity the following compile time definitions were changed, folks + with custom compilation options in their Configuration should make + appropriate changes: + + SAFE_UNSERIALIZED_ACCEPT - SINGLE_LISTEN_UNSERIALIZED_ACCEPT + HAVE_MMAP - USE_MMAP_SCOREBOARD +HAVE_SHMGET - USE_SHMGET_SCOREBOARD + + [Jim Jagielski] + *) PORT: UnixWare 2.1.2 SMP appears to require USE_FCNTL_SERIALIZED_ACCEPT, as do various earlier versions. It should be safe on all versions. Unixware 1.x appears to have the same SIGHUP bug as solaris does with
cvs commit: apachen/src CHANGES
dgaudet 98/01/22 15:23:09 Modified:src CHANGES Log: tab damage Revision ChangesPath 1.591 +2 -2 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.590 retrieving revision 1.591 diff -u -r1.590 -r1.591 --- CHANGES 1998/01/22 23:22:10 1.590 +++ CHANGES 1998/01/22 23:23:06 1.591 @@ -4,8 +4,8 @@ with custom compilation options in their Configuration should make appropriate changes: - SAFE_UNSERIALIZED_ACCEPT - SINGLE_LISTEN_UNSERIALIZED_ACCEPT - HAVE_MMAP - USE_MMAP_SCOREBOARD +SAFE_UNSERIALIZED_ACCEPT - SINGLE_LISTEN_UNSERIALIZED_ACCEPT +HAVE_MMAP - USE_MMAP_SCOREBOARD HAVE_SHMGET - USE_SHMGET_SCOREBOARD [Jim Jagielski]
cvs commit: apache/src Configuration.tmpl
dgaudet 98/01/23 10:53:41 Modified:src Tag: APACHE_1_2_X Configuration.tmpl Log: I'm tired of the damn bug reports. Revision ChangesPath No revision No revision 1.63.2.2 +3 -0 apache/src/Configuration.tmpl Index: Configuration.tmpl === RCS file: /export/home/cvs/apache/src/Configuration.tmpl,v retrieving revision 1.63.2.1 retrieving revision 1.63.2.2 diff -u -r1.63.2.1 -r1.63.2.2 --- Configuration.tmpl1997/10/22 00:18:43 1.63.2.1 +++ Configuration.tmpl1998/01/23 18:53:40 1.63.2.2 @@ -41,6 +41,9 @@ # Settings here have priority; If not set, Configure will attempt to guess # the C compiler, and set OPTIM to '-O2' # +# REDHAT LINUX 5.0 USERS PLEASE NOTE! You have to add -lcrypt to +# EXTRA_LIBS. This is fixed in 1.3 but will not be fixed in 1.2. +# EXTRA_CFLAGS= EXTRA_LFLAGS= EXTRA_LIBS=
cvs commit: apachen STATUS
dgaudet 98/01/24 10:31:01 Modified:.STATUS Log: a sunny day Revision ChangesPath 1.123 +1 -1 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.122 retrieving revision 1.123 diff -u -r1.122 -r1.123 --- STATUS1998/01/24 18:28:05 1.122 +++ STATUS1998/01/24 18:31:00 1.123 @@ -210,7 +210,7 @@ * Maybe moving *all* of the *.h header files into a new src/include directory? - Status: Ken +1 + Status: Ken +1, Dean +1 * Renaming the apache CVS module to apache-1.2 and the apachen module to apache-1.3 - and, at some point,
cvs commit: apachen/src/modules/standard mod_cgi.c mod_env.c mod_include.c mod_negotiation.c mod_setenvif.c
dgaudet 98/01/24 11:00:28 Modified:src CHANGES src/main alloc.c alloc.h src/modules/standard mod_cgi.c mod_env.c mod_include.c mod_negotiation.c mod_setenvif.c Log: Clean up the usage of the table API. There have always been enough routines in alloc.h to treat table as an opaque type, however even we got lazy at times and didn't do the right thing. This change causes compile time errors for folks who aren't treating table as an opaque type. It was built as part of my table hashing patch, but the hashing has all been removed (since it didn't appear to be a win). Reviewed by: Paul Sutton Revision ChangesPath 1.595 +8 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.594 retrieving revision 1.595 diff -u -r1.594 -r1.595 --- CHANGES 1998/01/24 16:27:53 1.594 +++ CHANGES 1998/01/24 19:00:18 1.595 @@ -1,5 +1,13 @@ Changes with Apache 1.3b4 + *) typedef array_header table removed from alloc.h, folks should have + been writing to use table as if it were an opaque type, but even + some standard modules got this wrong. By changing the definition + to typedef struct table table module authors will receive compile + time warnings that they're doing the wrong thing. This change + facilitates future changes with more sophisticated table + structures. [Dean Gaudet] + *) Rename new_connection() to ap__new_connection() to avoid namespace collision with LDAP library routines. The ap__ prefix means it's a private non-API interface, as opposed to ap_. 1.68 +75 -43apachen/src/main/alloc.c Index: alloc.c === RCS file: /export/home/cvs/apachen/src/main/alloc.c,v retrieving revision 1.67 retrieving revision 1.68 diff -u -r1.67 -r1.68 --- alloc.c 1998/01/07 16:45:59 1.67 +++ alloc.c 1998/01/24 19:00:21 1.68 @@ -584,10 +584,8 @@ * The 'array' functions... */ -API_EXPORT(array_header *) make_array(pool *p, int nelts, int elt_size) +static void make_array_core(array_header *res, pool *p, int nelts, int elt_size) { -array_header *res = (array_header *) palloc(p, sizeof(array_header)); - if (nelts 1) nelts = 1; /* Assure sanity if someone asks for * array of zero elts. @@ -599,7 +597,13 @@ res-elt_size = elt_size; res-nelts = 0; /* No active elements yet... */ res-nalloc = nelts; /* ...but this many allocated */ +} + +API_EXPORT(array_header *) make_array(pool *p, int nelts, int elt_size) +{ +array_header *res = (array_header *) palloc(p, sizeof(array_header)); +make_array_core(res, p, nelts, elt_size); return res; } @@ -658,17 +662,21 @@ * overhead of the full copy only where it is really needed. */ -API_EXPORT(array_header *) copy_array_hdr(pool *p, const array_header *arr) +static ap_inline void copy_array_hdr_core(array_header *res, +const array_header *arr) { -array_header *res = (array_header *) palloc(p, sizeof(array_header)); - res-elts = arr-elts; - -res-pool = p; res-elt_size = arr-elt_size; res-nelts = arr-nelts; res-nalloc = arr-nelts;/* Force overflow on push */ +} + +API_EXPORT(array_header *) copy_array_hdr(pool *p, const array_header *arr) +{ +array_header *res = (array_header *) palloc(p, sizeof(array_header)); +res-pool = p; +copy_array_hdr_core(res, arr); return res; } @@ -690,35 +698,50 @@ * The table functions. */ +/* XXX: if you tweak this you should look at is_empty_table() and table_elts() + * in alloc.h */ +struct table { +/* This has to be first to promote backwards compatibility with + * older modules which cast a table * to an array_header *... + * they should use the table_elts() function for most of the + * cases they do this for. + */ +array_header a; +}; + + API_EXPORT(table *) make_table(pool *p, int nelts) { -return make_array(p, nelts, sizeof(table_entry)); +table *t = palloc(p, sizeof(table)); + +make_array_core(t-a, p, nelts, sizeof(table_entry)); +return t; } API_EXPORT(table *) copy_table(pool *p, const table *t) { -return copy_array(p, t); -} +table *new = palloc(p, sizeof(table)); -API_EXPORT(void) clear_table(table *t) -{ -t-nelts = 0; +make_array_core(new-a, p, t-a.nalloc, sizeof(table_entry)); +memcpy(new-a.elts, t-a.elts, t-a.nelts * sizeof(table_entry)); +new-a.nelts = t-a.nelts; +return new
cvs commit: apachen/src/modules/proxy mod_proxy.c
dgaudet 98/01/24 12:30:08 Modified:src/modules/proxy mod_proxy.c Log: don't waste memory allocating an error message... use %s and such Revision ChangesPath 1.32 +2 -2 apachen/src/modules/proxy/mod_proxy.c Index: mod_proxy.c === RCS file: /export/home/cvs/apachen/src/modules/proxy/mod_proxy.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- mod_proxy.c 1998/01/21 22:09:57 1.31 +++ mod_proxy.c 1998/01/24 20:30:07 1.32 @@ -253,8 +253,8 @@ table_set(r-headers_out, Location, nuri); aplog_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, r-server, - pstrcat(r-pool, Domain missing: , r-uri, sent to , nuri, - ref ? from : NULL, ref, NULL)); + Domain missing: %s sent to %s from %s, r-uri, nuri, + ref ? ref : -); return REDIRECT; }
cvs commit: apachen/src/modules/proxy proxy_cache.c
dgaudet 98/01/24 12:43:44 Modified:src/modules/proxy proxy_cache.c Log: When deleting a value from a table, use table_unset() not table_set(key,NULL). The proxy has all of its own table manipulation routines... like it has struct hdr_entry, and proxy_get_header() and all this crap. But it was mixing the use of the real table routines and its own routines. Clean this up. (Ultimately someone should clean it up to use the real table routines, I can't see why it doesn't.) Revision ChangesPath 1.33 +7 -5 apachen/src/modules/proxy/proxy_cache.c Index: proxy_cache.c === RCS file: /export/home/cvs/apachen/src/modules/proxy/proxy_cache.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- proxy_cache.c 1998/01/07 16:46:36 1.32 +++ proxy_cache.c 1998/01/24 20:43:43 1.33 @@ -476,7 +476,7 @@ int proxy_cache_check(request_rec *r, char *url, struct cache_conf *conf, struct cache_req **cr) { -char hashfile[66], *imstr, *pragma, *p, *auth; +char hashfile[66], *imstr, *pragma, *auth; struct cache_req *c; time_t now; BUFF *cachefp; @@ -499,7 +499,7 @@ imstr = proxy_date_canon(r-pool, imstr); c-ims = parseHTTPdate(imstr); if (c-ims == BAD_DATE) /* bad or out of range date; remove it */ - table_set(r-headers_in, If-Modified-Since, NULL); + table_unset(r-headers_in, If-Modified-Since); } /* find the filename for this cache entry */ @@ -563,9 +563,11 @@ /* CHECKME: surely this was wrong? (Ben) p = table_get(r-headers_in, Expires); */ - p = table_get(c-hdrs, Expires); - if (p != NULL) - table_set(r-headers_out, Expires, p); + struct hdr_entry *q; + + q = proxy_get_header(c-hdrs, Expires); + if (q != NULL q-value != NULL) + table_set(r-headers_out, Expires, q-value); } pclosef(r-pool, cachefp-fd); Explain0(Use local copy, cached file hasn't changed);
cvs commit: apachen/src PORTING
dgaudet 98/01/24 18:07:43 Modified:src PORTING Log: note NEED_HASHBANG_EMUL Revision ChangesPath 1.20 +4 -0 apachen/src/PORTING Index: PORTING === RCS file: /export/home/cvs/apachen/src/PORTING,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- PORTING 1998/01/23 00:36:37 1.19 +++ PORTING 1998/01/25 02:07:43 1.20 @@ -334,6 +334,10 @@ an int *len on some architectures and a size_t *len on others. If left undefined apache will default it to int. + NEED_HASHBANG_EMUL: + The execve()/etc. functions on this platform do not deal with #!, + so it must be emulated by Apache. + --- Conclusion: ---
cvs commit: apachen/htdocs/manual/mod mod_mime_magic.html
dgaudet 98/01/24 19:52:20 Modified:src CHANGES src/modules/standard mod_mime_magic.c htdocs/manual/mod mod_mime_magic.html Log: - no need to use stat() since r-finfo is already what we need - no need to play with atime/mtime crud, the web server doesn't preserve that info normally anyhow - deal with r-finfo.st_mode == 0 || !r-filename (i.e. not a disk file) - don't reference mime_module.type_checker, this should be controlled by the ordering within Configuration - work properly with multiple vhosts - doc update: even prior to this patch, the code was disabled if there was no MimeMagicFile directive. Revision ChangesPath 1.599 +6 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.598 retrieving revision 1.599 diff -u -r1.598 -r1.599 --- CHANGES 1998/01/25 01:40:53 1.598 +++ CHANGES 1998/01/25 03:52:15 1.599 @@ -1,5 +1,11 @@ Changes with Apache 1.3b4 + *) More mod_mime_magic cleanup: fewer syscalls; should handle files + which don't exist on disk more gracefully; handles vhosts properly. + Update documentation to reflect the code -- if there's no + MimeMagicFile directive then the module is not enabled. + [Dean Gaudet] + *) PORT: Some older *nix dialects cannot automatically start scripts which begin with a #! interpreter line (the shell starts the scripts appropriately on these platforms). Apache now supports starting of 1.24 +56 -95apachen/src/modules/standard/mod_mime_magic.c Index: mod_mime_magic.c === RCS file: /export/home/cvs/apachen/src/modules/standard/mod_mime_magic.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- mod_mime_magic.c 1998/01/07 16:46:53 1.23 +++ mod_mime_magic.c 1998/01/25 03:52:18 1.24 @@ -136,9 +136,6 @@ #define MODNAMEmod_mime_magic #define MIME_MAGIC_DEBUG0 -#ifndef MAGIC -#define MAGIC conf/magic -#endif #define MIME_BINARY_UNKNOWNapplication/octet-stream #define MIME_TEXT_UNKNOWNtext/plain @@ -258,7 +255,7 @@ static int uncompress(request_rec *, int, const unsigned char *, unsigned char **, int); static long from_oct(int, char *); -static int fsmagic(request_rec *r, const char *fn, struct stat *sb); +static int fsmagic(request_rec *r, const char *fn); /* * includes for ASCII substring recognition formerly names.h in file @@ -296,7 +293,8 @@ message/rfc822,/* mail text, */ message/news, /* news text, */ application/binary,/* can't happen error on names.h/types, */ -0}; +0 +}; static struct names { char *name; @@ -495,7 +493,6 @@ */ module mime_magic_module; -extern module mime_module; static void *create_magic_server_config(pool *p, server_rec *d) { @@ -511,17 +508,8 @@ palloc(p, sizeof(magic_server_config_rec)); new-magicfile = add-magicfile ? add-magicfile : base-magicfile; -if (add-magic add-last) { - new-magic = add-magic; - new-last = add-last; -} -else if (base-magic base-last) { - new-magic = base-magic; - new-last = base-last; -} -else { - new-magic = new-last = NULL; -} +new-magic = NULL; +new-last = NULL; return new; } @@ -545,7 +533,7 @@ static command_rec mime_magic_cmds[] = { {MimeMagicFile, set_magicfile, NULL, RSRC_CONF, TAKE1, - Path to MIME Magic file (in file(1) format, default MAGIC )}, + Path to MIME Magic file (in file(1) format)}, {NULL} }; @@ -847,15 +835,13 @@ { int fd = 0; unsigned char buf[HOWMANY + 1]; /* one extra for terminating '\0' */ -struct utimbuf utbuf; -struct stat sb; int nbytes = 0; /* number of bytes read from a datafile */ int result; /* * first try judging the file based on its filesystem status */ -switch ((result = fsmagic(r, r-filename, sb))) { +switch ((result = fsmagic(r, r-filename))) { case DONE: magic_rsl_putchar(r, '\n'); return result; @@ -868,10 +854,6 @@ if ((fd = popenf(r-pool, r-filename, O_RDONLY, 0)) 0) { /* We can't open it, but we were able to stat it. */ - /* - * if (sb.st_mode 0002) magic_rsl_puts(r,writable, ); - * if (sb.st_mode 0111) magic_rsl_puts(r,executable, ); - */ aplog_error(APLOG_MARK, APLOG_ERR, r-server, MODNAME : can't read `%s', r-filename); /* let some other handler decide what
cvs commit: apachen/src/modules/standard mod_alias.c mod_dir.c mod_expires.c mod_imap.c mod_include.c mod_log_config.c mod_negotiation.c mod_rewrite.c mod_setenvif.c mod_speling.c mod_unique_id.c mod_userdir.c mod_usertrack.c
dgaudet 98/01/26 11:50:30 Modified:.STATUS htdocs/manual new_features_1_3.html src CHANGES src/main alloc.c alloc.h http_config.h http_core.c http_protocol.c http_request.c util_script.c src/modules/proxy mod_proxy.c src/modules/standard mod_alias.c mod_dir.c mod_expires.c mod_imap.c mod_include.c mod_log_config.c mod_negotiation.c mod_rewrite.c mod_setenvif.c mod_speling.c mod_unique_id.c mod_userdir.c mod_usertrack.c Log: API additions: table_setn, table_addn, table_mergen... for speed! POOL_DEBUG support for correctness. Submitted by: Dmitry Khrustalev [EMAIL PROTECTED], Dean Gaudet Reviewed by: Brian Behlendorf, Jim Jagielski Revision ChangesPath 1.131 +1 -0 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.130 retrieving revision 1.131 diff -u -r1.130 -r1.131 --- STATUS1998/01/26 18:24:25 1.130 +++ STATUS1998/01/26 19:50:05 1.131 @@ -138,6 +138,7 @@ * Add more compile time diagnosis to main's -V switch * [Port] Fix CGI-Execution for EBCDIC hosts. * Martin's [PATCH] Signing server generated pages +* Dmitry's table_*n API addition Available Patches: 1.39 +18 -0 apachen/htdocs/manual/new_features_1_3.html Index: new_features_1_3.html === RCS file: /export/home/cvs/apachen/htdocs/manual/new_features_1_3.html,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- new_features_1_3.html 1998/01/26 16:53:36 1.38 +++ new_features_1_3.html 1998/01/26 19:50:06 1.39 @@ -293,6 +293,12 @@ and IRIX. LICODEA HREF=mod/mod_log_config.htmlmod_log_config/A/CODE can be compile-time configured to buffer writes. +LIReplaced codestrncpy()/code with codeap_cpystrn()/code, a + routine which doesn't have to zero-fill the entire result. This + has dramatic effects on codemod_include/code speed. +LIAdditions to the internal table API (used for keeping lists of + key/value string pairs) provide for up to 20% performance + improvement in many situations. /UL PSee A HREF=misc/perf-tuning.htmlthe new performance @@ -461,6 +467,18 @@ is far more expensive and should only be used for testing with tools such as Electric Fence and Purify. See CODEmain/alloc.c/CODE for more details. + +LIstrongcodeap_cpystrn/code/strongbr +The new codestrncpy/code lookalike, with slightly different +semantics is much faster than codestrncpy/code because it +doesn't have to zero-fill the entire buffer. + +LIstrongcodetable_addn/code, codetable_setn/code, +codetable_mergen/code/strongbr +These new functions do bnot/b call codepstrdup/code +on their arguments. This provides for big speedups. There is +also some debugging support to ensure code uses them properly. +See codesrc/CHANGES/code for more information. /UL 1.600 +20 -0 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.599 retrieving revision 1.600 diff -u -r1.599 -r1.600 --- CHANGES 1998/01/25 03:52:15 1.599 +++ CHANGES 1998/01/26 19:50:08 1.600 @@ -1,5 +1,25 @@ Changes with Apache 1.3b4 + *) table_add, table_merge, and table_set include implicit pstrdup() + of the key and value. But in many cases this is not required + because the key/value is a constant, or the value has been built + by pstrcat() or other similar means. New routines table_addn, + table_mergen, and table_setn have been added to the API, these + routines do not pstrdup() their arguments. The core code and + standard modules were changed to take advantage of these routines. + The resulting server is up to 20% faster in some situations. + + Note that it is easy to get code subtly wrong if you pass a key/value + which is in a pool other than the pool of the table. The only + safe thing to do is to pass key/values which are in the pool of + the table, or in one of the ancestors of the pool of the table. + i.e. if the table is part of a subrequest, a value from the main + request's pool is OK since the subrequest pool is a sub_pool of the + main request's pool (and therefore has a lifespan at most as long as + the main pool). There is debugging code which can detect improper + usage, enabled
cvs commit: apachen/src/main alloc.c
dgaudet 98/01/26 18:37:52 Modified:src/main alloc.c Log: more pool debugging -- copy_table() and overlay_tables() have implicit assumptions about the pool relationships of their arguments. There are actually some bugs in the core code I'll fix in a few minutes. Revision ChangesPath 1.70 +24 -0 apachen/src/main/alloc.c Index: alloc.c === RCS file: /export/home/cvs/apachen/src/main/alloc.c,v retrieving revision 1.69 retrieving revision 1.70 diff -u -r1.69 -r1.70 --- alloc.c 1998/01/26 19:50:10 1.69 +++ alloc.c 1998/01/27 02:37:51 1.70 @@ -873,6 +873,15 @@ { table *new = palloc(p, sizeof(table)); +#ifdef POOL_DEBUG +/* we don't copy keys and values, so it's necessary that t-a.pool + * have a life span at least as long as p + */ +if (!pool_is_ancestor(t-a.pool, p)) { + fprintf(stderr, copy_table: t's pool is not an ancestor of p\n); + abort(); +} +#endif make_array_core(new-a, p, t-a.nalloc, sizeof(table_entry)); memcpy(new-a.elts, t-a.elts, t-a.nelts * sizeof(table_entry)); new-a.nelts = t-a.nelts; @@ -1083,6 +1092,21 @@ API_EXPORT(table *) overlay_tables(pool *p, const table *overlay, const table *base) { table *res; + +#ifdef POOL_DEBUG +/* we don't copy keys and values, so it's necessary that + * overlay-a.pool and base-a.pool have a life span at least + * as long as p + */ +if (!pool_is_ancestor(overlay-a.pool, p)) { + fprintf(stderr, overlay_tables: overlay's pool is not an ancestor of p\n); + abort(); +} +if (!pool_is_ancestor(base-a.pool, p)) { + fprintf(stderr, overlay_tables: base's pool is not an ancestor of p\n); + abort(); +} +#endif res = palloc(p, sizeof(table)); /* behave like append_arrays */
cvs commit: apachen/src/main http_request.c
dgaudet 98/01/26 18:39:42 Modified:src/main http_request.c Log: When calling rename_original_environment we should be creating the new table in the environment of the subrequest, not the main request. Otherwise it will consume memory when it shouldn't be... and will trigger POOL_DEBUG aborts. Revision ChangesPath 1.102 +1 -1 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.101 retrieving revision 1.102 diff -u -r1.101 -r1.102 --- http_request.c1998/01/26 19:50:13 1.101 +++ http_request.c1998/01/27 02:39:41 1.102 @@ -1219,7 +1219,7 @@ new-headers_in = r-headers_in; new-headers_out = make_table(r-pool, 5); new-err_headers_out = r-err_headers_out; -new-subprocess_env = rename_original_env(r-pool, r-subprocess_env); +new-subprocess_env = rename_original_env(new-pool, r-subprocess_env); new-notes = make_table(r-pool, 5); new-htaccess= r-htaccess;
cvs commit: apachen/src/main http_request.c
dgaudet 98/01/26 18:41:13 Modified:src/main http_request.c Log: Oh nevermind. I didn't realise internal redirected requests shared the same pool as the main request. That's odd, maybe there's some savings to be had... some other day. Revision ChangesPath 1.103 +1 -1 apachen/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apachen/src/main/http_request.c,v retrieving revision 1.102 retrieving revision 1.103 diff -u -r1.102 -r1.103 --- http_request.c1998/01/27 02:39:41 1.102 +++ http_request.c1998/01/27 02:41:11 1.103 @@ -1219,7 +1219,7 @@ new-headers_in = r-headers_in; new-headers_out = make_table(r-pool, 5); new-err_headers_out = r-err_headers_out; -new-subprocess_env = rename_original_env(new-pool, r-subprocess_env); +new-subprocess_env = rename_original_env(r-pool, r-subprocess_env); new-notes = make_table(r-pool, 5); new-htaccess= r-htaccess;
cvs commit: apachen/src/main buff.c
dgaudet 98/01/26 21:35:34 Modified:.STATUS src CHANGES src/main buff.c Log: really fix Rasmus' chunking problem this time introduce LARGE_WRITE_THRESHOLD tunable for determining when large_write() is a good idea Reviewed by: Rasmus Lerdorf Revision ChangesPath 1.132 +1 -1 apachen/STATUS Index: STATUS === RCS file: /export/home/cvs/apachen/STATUS,v retrieving revision 1.131 retrieving revision 1.132 diff -u -r1.131 -r1.132 --- STATUS1998/01/26 19:50:05 1.131 +++ STATUS1998/01/27 05:35:22 1.132 @@ -70,7 +70,7 @@ * Dean's [PATCH] ap_snprintf should be more sane (fwd) * Jim's/Ken's move of main/util_snprintf.c to ap/ap_snprintf.c * [PATCH] Re: [BUGFIXES] Wrong GID for PID file and UMASK for logs -* Dean's [PATCH] fix Rasmus' chunking error +* Dean's [PATCH] fix Rasmus' chunking error (take 2, really fix it) * [PATCH] PR#1366: fix result of send_fd_length * Ben Hyde's [PATCH] Finish suite of mutex ops for non-threaded platforms * Ben Hyde's [PATCH] Serialize the update to pool.sub_* in destroy_pool 1.601 +15 -5 apachen/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apachen/src/CHANGES,v retrieving revision 1.600 retrieving revision 1.601 diff -u -r1.600 -r1.601 --- CHANGES 1998/01/26 19:50:08 1.600 +++ CHANGES 1998/01/27 05:35:27 1.601 @@ -241,11 +241,21 @@ *) send_fd_length() did not calculate total_bytes_sent properly. [Ben Reser [EMAIL PROTECTED]] PR#1366 - *) The large_write() changes tickled a bug in bputc(), this would - show up as certain modules not working with Internet Explorer 4.0. - Fix this bug, and also fix a performance bug related to bputc() - causing a large_write() -- don't do large_write() unless there's - at least two bytes to write. [Dean Gaudet] + *) The bputc() macro was not properly integrated with the chunking + code; in many cases modules using bputc() could cause completely + bogus chunked output. (Typically this will show up as problems + with Internet Explorer 4.0 reading a page, but other browsers + having no problem.) [Dean Gaudet] + + *) Create LARGE_WRITE_THRESHOLD define which determines how many + bytes have to be supplied to bwrite() before it will consider + doing a writev() to assemble multiple buffers in one system + call. This is critical for modules such as mod_include, + mod_autoindex, mod_php3 which all use bputc()/bputs() of smaller + strings in some cases. The result would be extra effort + setting up writev(), and in many cases extra effort building + chunks. The default is 31, it can be override at compile + time. [Dean Gaudet] *) Move the gid switching code into the child so that log files and pid files are opened with the root gid. 1.60 +39 -12apachen/src/main/buff.c Index: buff.c === RCS file: /export/home/cvs/apachen/src/main/buff.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -r1.59 -r1.60 --- buff.c1998/01/26 16:46:07 1.59 +++ buff.c1998/01/27 05:35:32 1.60 @@ -71,7 +71,21 @@ #include bstring.h /* for IRIX, FD_SET calls bzero() */ #endif +#ifndef DEFAULT_BUFSIZE #define DEFAULT_BUFSIZE (4096) +#endif + +/* bwrite()s of greater than this size can result in a large_write() call, + * which can result in a writev(). It's a little more work to set up the + * writev() rather than copy bytes into the buffer, so we don't do it for small + * writes. This is especially important when chunking (which is a very likely + * source of small writes if it's a module using bputc/bputs)... because we + * have the expense of actually building two chunks for each writev(). + */ +#ifndef LARGE_WRITE_THRESHOLD +#define LARGE_WRITE_THRESHOLD 31 +#endif + /* * Buffered I/O routines. @@ -347,7 +361,13 @@ } /* - * start chunked encoding + * Start chunked encoding. + * + * Note that in order for bputc() to be an efficient macro we have to guarantee + * that start_chunk() has always been called on the buffer before we leave any + * routine in this file. Said another way, if a routine here uses end_chunk() + * and writes something on the wire, then it has to call start_chunk() or set + * an error condition before returning. */ static void start_chunk(BUFF *fb) { @@ -865,16 +885,9 @@ API_EXPORT(int) bflsbuf(int c, BUFF *fb) { char ss[1]; -int rc; ss[0] = c; -rc = bwrite(fb, ss, 1); -/* We do
cvs commit: apachen/src .gdbinit
dgaudet 98/01/26 22:02:51 Added: src .gdbinit Log: I needed a gdb macro to dump the contents of a table... I figured others might need it too. Revision ChangesPath 1.1 apachen/src/.gdbinit Index: .gdbinit === define dump_table set $t = (table_entry *)((array_header *)$arg0)-elts set $n = ((array_header *)$arg0)-nelts set $i = 0 while $i $n printf [%u] '%s'='%s'\n, $i, $t[$i].key, $t[$i].val set $i = $i + 1 end end document dump_table Print the key/value pairs in a table. end
cvs commit: apache/src buff.c
dgaudet 98/01/26 22:25:05 Modified:src Tag: APACHE_1_2_X buff.c Log: This is the proper fix for chunked encoding and bputc()... the last one misses cases where bputc() is mixed with other bwrite() calls. Revision ChangesPath No revision No revision 1.26.2.3 +12 -9 apache/src/buff.c Index: buff.c === RCS file: /export/home/cvs/apache/src/buff.c,v retrieving revision 1.26.2.2 retrieving revision 1.26.2.3 diff -u -r1.26.2.2 -r1.26.2.3 --- buff.c1998/01/14 00:02:56 1.26.2.2 +++ buff.c1998/01/27 06:25:02 1.26.2.3 @@ -187,7 +187,13 @@ } /* - * start chunked encoding + * Start chunked encoding. + * + * Note that in order for bputc() to be an efficient macro we have to + * guarantee that start_chunk() has always been called on the buffer before we + * leave any routine in this file. Said another way, if a routine here uses + * end_chunk() and writes something on the wire, then it has to call + * start_chunk() or set an error condition before returning. */ static void start_chunk( BUFF *fb ) @@ -584,16 +590,9 @@ bflsbuf(int c, BUFF *fb) { char ss[1]; -int rc; ss[0] = c; -rc = bwrite(fb, ss, 1); -/* We do start_chunk() here so that the bputc macro can be smaller - * and faster - */ -if (rc == 1 (fb-flags B_CHUNK)) - start_chunk(fb); -return rc; +return bwrite(fb, ss, 1); } /* @@ -913,6 +912,10 @@ if (fb-flags B_EOUT) return -1; } + +if (fb-flags B_CHUNK) + start_chunk(fb); + return 0; }
cvs commit: apache-1.3 STATUS
dgaudet 98/01/27 00:38:46 Modified:.STATUS Log: testing commit on 1.3 branch Revision ChangesPath 1.133 +0 -2 apache-1.3/STATUS Index: STATUS === RCS file: /export/home/cvs/apache-1.3/STATUS,v retrieving revision 1.132 retrieving revision 1.133 diff -u -r1.132 -r1.133 --- STATUS1998/01/27 05:35:22 1.132 +++ STATUS1998/01/27 08:38:45 1.133 @@ -1,5 +1,3 @@ - - Apache 1.3 STATUS: Release:
cvs commit: apache-1.3/src/modules/standard mod_negotiation.c
dgaudet 98/01/27 02:00:46 Modified:src/main alloc.c alloc.h src/modules/standard mod_negotiation.c Log: Another iteration in getting POOL_DEBUG to work correctly. It turns out there are many more subtle interactions caused by the mod_negotiation fast redirect. So I added an API hint function pool_join()... which is normally a nop, but if POOL_DEBUG is defined this tells the debugging code that the sub pool is guaranteed to exist as long as the parent pool does. Revision ChangesPath 1.71 +31 -0 apache-1.3/src/main/alloc.c Index: alloc.c === RCS file: /export/home/cvs/apache-1.3/src/main/alloc.c,v retrieving revision 1.70 retrieving revision 1.71 diff -u -r1.70 -r1.71 --- alloc.c 1998/01/27 02:37:51 1.70 +++ alloc.c 1998/01/27 10:00:38 1.71 @@ -361,6 +361,9 @@ #ifdef ALLOC_USE_MALLOC void *allocation_list; #endif +#ifdef POOL_DEBUG +struct pool *joined; +#endif }; pool *permanent_pool; @@ -576,6 +579,9 @@ if (a == NULL) { return 1; } +while (a-joined) { + a = a-joined; +} while (b) { if (a == b) { return 1; @@ -583,6 +589,31 @@ b = b-parent; } return 0; +} + +/* All blocks belonging to sub will be changed to point to p + * instead. This is a guarantee by the caller that sub will not + * be destroyed before p is. + */ +API_EXPORT(void) pool_join(pool *p, pool *sub) +{ +union block_hdr *b; + +if (!pool_is_ancestor(p, sub)) { + fprintf(stderr, pool_join: p is not an ancestor of sub\n); + abort(); +} +block_alarms(); +while (p-joined) { + p = p-joined; +} +sub-joined = p; +for (b = global_block_list; b; b = b-h.global_next) { + if (b-h.owning_pool == sub) { + b-h.owning_pool = p; + } +} +unblock_alarms(); } #endif 1.44 +9 -0 apache-1.3/src/main/alloc.h Index: alloc.h === RCS file: /export/home/cvs/apache-1.3/src/main/alloc.h,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- alloc.h 1998/01/26 19:50:10 1.43 +++ alloc.h 1998/01/27 10:00:40 1.44 @@ -87,6 +87,15 @@ API_EXPORT(pool *) make_sub_pool(pool *);/* All pools are subpools of permanent_pool */ API_EXPORT(void) destroy_pool(pool *); +/* used to guarantee to the pool debugging code that the sub pool will not be + * destroyed before the parent pool + */ +#ifndef POOL_DEBUG +#define pool_join(a,b) +#else +API_EXPORT(void) pool_join(pool *p, pool *sub); +#endif + /* Clearing out EVERYTHING in an pool... destroys any sub-pools */ API_EXPORT(void) clear_pool(struct pool *); 1.66 +11 -10apache-1.3/src/modules/standard/mod_negotiation.c Index: mod_negotiation.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_negotiation.c,v retrieving revision 1.65 retrieving revision 1.66 diff -u -r1.65 -r1.66 --- mod_negotiation.c 1998/01/26 19:50:22 1.65 +++ mod_negotiation.c 1998/01/27 10:00:44 1.66 @@ -2182,6 +2182,13 @@ set_neg_headers(r, neg, na_not_applied); } +/* now do a fast redirect ... promote the sub_req into the main req */ +/* We need to tell POOL_DEBUG that we're guaranteeing that sub_req-pool + * will exist as long as r-pool. Otherwise we run into troubles because + * some values in this request will be allocated in r-pool, and others in + * sub_req-pool. + */ +pool_join(r-pool, sub_req-pool); r-filename = sub_req-filename; r-handler = sub_req-handler; r-content_type = sub_req-content_type; @@ -2190,19 +2197,13 @@ r-content_language = sub_req-content_language; r-finfo = sub_req-finfo; r-per_dir_config = sub_req-per_dir_config; -/* You may wonder why we're using the sub_req-pool here. It's to support - * POOL_DEBUG in alloc.c. sub_req-pool will have the same lifetime as - * r-pool, we guarantee that by not destroying the sub request below. - * We have to guarantee that because we've promoted some of the values - * from sub_req-pool to r-foobar, like r-filename. - */ /* copy output headers from subrequest, but leave negotiation headers */ -r-notes = overlay_tables(sub_req-pool, sub_req-notes, r-notes); -r-headers_out = overlay_tables(sub_req-pool, sub_req-headers_out, +r-notes = overlay_tables(r-pool, sub_req-notes, r-notes); +r-headers_out = overlay_tables(r-pool, sub_req-headers_out, r-headers_out); -r-err_headers_out
cvs commit: apache-1.3/src/main alloc.c
dgaudet 98/01/27 02:04:37 Modified:src/main alloc.c Log: I didn't implement a fully general pool_join... so I should test that the inputs really are what I expect. Revision ChangesPath 1.72 +3 -2 apache-1.3/src/main/alloc.c Index: alloc.c === RCS file: /export/home/cvs/apache-1.3/src/main/alloc.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -r1.71 -r1.72 --- alloc.c 1998/01/27 10:00:38 1.71 +++ alloc.c 1998/01/27 10:04:35 1.72 @@ -599,8 +599,9 @@ { union block_hdr *b; -if (!pool_is_ancestor(p, sub)) { - fprintf(stderr, pool_join: p is not an ancestor of sub\n); +/* We could handle more general cases... but this is it for now. */ +if (sub-parent != p) { + fprintf(stderr, pool_join: p is not parent of sub\n); abort(); } block_alarms();
cvs commit: apache-1.3/src/modules/standard mod_unique_id.c
dgaudet 98/01/27 02:28:34 Modified:.STATUS src CHANGES src/modules/standard mod_unique_id.c Log: don't generate a second id on internal_redirects Revision ChangesPath 1.134 +1 -0 apache-1.3/STATUS Index: STATUS === RCS file: /export/home/cvs/apache-1.3/STATUS,v retrieving revision 1.133 retrieving revision 1.134 diff -u -r1.133 -r1.134 --- STATUS1998/01/27 08:38:45 1.133 +++ STATUS1998/01/27 10:28:29 1.134 @@ -137,6 +137,7 @@ * [Port] Fix CGI-Execution for EBCDIC hosts. * Martin's [PATCH] Signing server generated pages * Dmitry's table_*n API addition +* mod_unique_id didn't deal with internal_redirect properly Available Patches: 1.602 +4 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.601 retrieving revision 1.602 diff -u -r1.601 -r1.602 --- CHANGES 1998/01/27 05:35:27 1.601 +++ CHANGES 1998/01/27 10:28:31 1.602 @@ -1,5 +1,9 @@ Changes with Apache 1.3b4 + *) mod_unique_id was erroneously generating a second unique id when + an internal redirect occured. Such redirects occur, for example, + when processing a DirectoryIndex match. [Dean Gaudet] + *) table_add, table_merge, and table_set include implicit pstrdup() of the key and value. But in many cases this is not required because the key/value is a constant, or the value has been built 1.11 +9 -0 apache-1.3/src/modules/standard/mod_unique_id.c Index: mod_unique_id.c === RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_unique_id.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- mod_unique_id.c 1998/01/26 19:50:25 1.10 +++ mod_unique_id.c 1998/01/27 10:28:33 1.11 @@ -281,6 +281,15 @@ char str[19 + 1]; const unsigned char *x; unsigned short counter; +char *e; + +/* copy the unique_id if this is an internal redirect (we're never + * actually called for sub requests, so we don't need to test for + * them) */ +if (r-prev (e = table_get(r-subprocess_env, REDIRECT_UNIQUE_ID))) { + table_setn(r-subprocess_env, UNIQUE_ID, e); + return DECLINED; +} cur_unique_id.stamp = htonl(r-request_time);
cvs commit: apache-1.3/src/main http_main.c
dgaudet 98/01/28 02:00:34 Modified:src CHANGES src/main http_main.c Log: SIGURG doesn't exist everywhere. Submitted by: Mark Andrew Heinrich [EMAIL PROTECTED] Reviewed by: Dean Gaudet Revision ChangesPath 1.603 +3 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.602 retrieving revision 1.603 diff -u -r1.602 -r1.603 --- CHANGES 1998/01/27 10:28:31 1.602 +++ CHANGES 1998/01/28 10:00:25 1.603 @@ -1,5 +1,8 @@ Changes with Apache 1.3b4 + *) SIGURG doesn't exist everywhere. + [Mark Andrew Heinrich [EMAIL PROTECTED]] + *) mod_unique_id was erroneously generating a second unique id when an internal redirect occured. Such redirects occur, for example, when processing a DirectoryIndex match. [Dean Gaudet] 1.277 +2 -0 apache-1.3/src/main/http_main.c Index: http_main.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v retrieving revision 1.276 retrieving revision 1.277 diff -u -r1.276 -r1.277 --- http_main.c 1998/01/25 18:53:55 1.276 +++ http_main.c 1998/01/28 10:00:30 1.277 @@ -2946,7 +2946,9 @@ */ ap_setjmp(jmpbuffer); #ifndef __EMX__ +#ifdef SIGURG signal(SIGURG, timeout); +#endif #endif signal(SIGPIPE, timeout); signal(SIGALRM, alrm_handler);
cvs commit: apache-1.3/src/modules/standard mod_access.c mod_autoindex.c mod_cgi.c mod_include.c mod_rewrite.c
dgaudet 98/01/28 03:33:32 Modified:src CHANGES src/main http_protocol.c http_vhost.c util.c src/modules/proxy mod_proxy.c src/modules/standard mod_access.c mod_autoindex.c mod_cgi.c mod_include.c mod_rewrite.c Log: RFC2068 says pretty much everything is case-insensitive... there are only a few exceptions. Clean up a bunch of cases where we got it wrong. Also clean up a few cases where modules used both case-sensitive and insensitive parsing of their parms. Revision ChangesPath 1.604 +3 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.603 retrieving revision 1.604 diff -u -r1.603 -r1.604 --- CHANGES 1998/01/28 10:00:25 1.603 +++ CHANGES 1998/01/28 11:33:19 1.604 @@ -1,5 +1,8 @@ Changes with Apache 1.3b4 + *) Some case-sensitivity issues cleaned up to be consistent with + RFC2068. [Dean Gaudet] + *) SIGURG doesn't exist everywhere. [Mark Andrew Heinrich [EMAIL PROTECTED]] 1.182 +2 -2 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.181 retrieving revision 1.182 diff -u -r1.181 -r1.182 --- http_protocol.c 1998/01/26 19:50:13 1.181 +++ http_protocol.c 1998/01/28 11:33:21 1.182 @@ -137,7 +137,7 @@ if (!(range = table_get(r-headers_in, Range))) range = table_get(r-headers_in, Request-Range); -if (!range || strncmp(range, bytes=, 6)) { +if (!range || strncasecmp(range, bytes=, 6)) { table_setn(r-headers_out, Accept-Ranges, bytes); return 0; } @@ -630,7 +630,7 @@ unsigned port; /* This routine parses full URLs, if they match the server */ -if (strncmp(uri, http://;, 7)) +if (strncasecmp(uri, http://;, 7)) return uri; name = pstrdup(r-pool, uri + 7); 1.4 +2 -2 apache-1.3/src/main/http_vhost.c Index: http_vhost.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_vhost.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- http_vhost.c 1998/01/07 16:46:17 1.3 +++ http_vhost.c 1998/01/28 11:33:22 1.4 @@ -191,7 +191,7 @@ my_addr = htonl(INADDR_ANY); is_an_ip_addr = 1; } -else if (strcmp(w, _default_) == 0 +else if (strcasecmp(w, _default_) == 0 || strcmp(w, 255.255.255.255) == 0) { my_addr = DEFAULT_VHOST_ADDR; is_an_ip_addr = 1; @@ -678,7 +678,7 @@ found: /* s is the first matching server, we're done */ r-server = r-connection-server = s; -if (r-hostlen !strncmp(r-uri, http://;, 7)) { +if (r-hostlen !strncasecmp(r-uri, http://;, 7)) { r-uri += r-hostlen; parse_uri(r, r-uri); } 1.90 +1 -1 apache-1.3/src/main/util.c Index: util.c === RCS file: /export/home/cvs/apache-1.3/src/main/util.c,v retrieving revision 1.89 retrieving revision 1.90 diff -u -r1.89 -r1.90 --- util.c1998/01/21 22:11:02 1.89 +++ util.c1998/01/28 11:33:22 1.90 @@ -1526,7 +1526,7 @@ if (ind(p-h_name, '.') == -1) { for (x = 0; p-h_aliases[x]; ++x) { if ((ind(p-h_aliases[x], '.') != -1) - (!strncmp(p-h_aliases[x], p-h_name, strlen(p-h_name + (!strncasecmp(p-h_aliases[x], p-h_name, strlen(p-h_name return pstrdup(a, p-h_aliases[x]); } return NULL; 1.34 +7 -7 apache-1.3/src/modules/proxy/mod_proxy.c Index: mod_proxy.c === RCS file: /export/home/cvs/apache-1.3/src/modules/proxy/mod_proxy.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- mod_proxy.c 1998/01/26 19:50:17 1.33 +++ mod_proxy.c 1998/01/28 11:33:24 1.34 @@ -302,7 +302,7 @@ /* Check URI's destination host against NoProxy hosts */ /* Bypass ProxyRemote server lookup if configured as NoProxy */ /* we only know how to handle communication to a proxy via http */ -/*if (strcmp(scheme, http) == 0) */ +/*if (strcasecmp(scheme, http) == 0) */ { int ii; struct dirconn_entry *list = (struct dirconn_entry *) conf-dirconn-elts; @@ -331,9 +331,9 @@ for (i = 0; i proxies-nelts; i++) { p = strchr(ents[i].scheme, ':');/* is it a partial URL
cvs commit: apache-1.2/support logresolve.c suexec.c
dgaudet 98/01/30 01:14:32 Modified:.ABOUT_APACHE CHANGES KEYS README conf httpd.conf-dist htdocs index.html htdocs/manual custom-error.html footer.html header.html new_features_1_2.html process-model.html suexec.html vhosts-in-depth.html virtual-host.html htdocs/manual/misc FAQ.html compat_notes.html fin_wait_2.html footer.html header.html index.html known_bugs.html nopgp.html perf-bsd44.html perf.html security_tips.html vif-info.html htdocs/manual/mod core.html directives.html footer.html header.html mod_auth_anon.html mod_auth_msql.html mod_browser.html mod_cern_meta.html mod_env.html mod_headers.html mod_include.html mod_mime.html mod_proxy.html mod_rewrite.html mod_status.html mod_userdir.html src CHANGES Configuration.tmpl Configure INSTALL Makefile.tmpl PORTING alloc.c buff.c buff.h conf.h http_bprintf.c http_conf_globals.h http_config.c http_config.h http_core.c http_main.c http_protocol.c http_protocol.h http_request.c httpd.h mod_auth_anon.c mod_browser.c mod_cern_meta.c mod_cgi.c mod_digest.c mod_dir.c mod_imap.c mod_include.c mod_info.c mod_negotiation.c mod_rewrite.c mod_rewrite.h mod_status.c mod_userdir.c mod_usertrack.c scoreboard.h util.c util_script.c src/helpers GuessOS src/modules/proxy mod_proxy.h proxy_cache.c proxy_ftp.c proxy_http.c proxy_util.c support logresolve.c suexec.c Added: .STATUS Removed: htdocs/manual/mod mod_autoindex.html src mod_autoindex.c Log: part of the surgery, this merges APACHE_1_2_X onto the main branch Revision ChangesPath 1.2 +4 -4 apache-1.2/ABOUT_APACHE Index: ABOUT_APACHE === RCS file: /export/home/cvs/apache-1.2/ABOUT_APACHE,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ABOUT_APACHE 1997/06/03 23:23:13 1.1 +++ ABOUT_APACHE 1998/01/30 09:12:39 1.2 @@ -67,16 +67,17 @@ -Current Apache Group, 1 June 1997 +Current Apache Group in alphabetical order as of 1 August 1997: Brian Behlendorf Organic Online, California Ken Coar Process Software Corporation, New England, USA Mark J. CoxUKWeb, UK + Ralf S. EngelschallMunich, Germany. Roy T. FieldingUC Irvine, California Dean GaudetSteam Tunnel Operations, California Rob HartillInternet Movie DB, UK Jim Jagielski jaguNET ISP, Maryland - Alexei Kosut Nueva High School, California + Alexei Kosut Stanford University, California Ben Laurie Freelance Consultant, UK Chuck Murcko The Topsail Group, Pennsylvania Aram W. Mirzadeh Qosina Corporation, New York @@ -99,8 +100,7 @@ Paul Richards (convinced the group to use remote CVS after 1.0), Kevin Hughes (creator of all those nifty icons), Henry Spencer (author of the regex library), Garey Smiley (OS/2 port), - Ralf S. Engelschall (mod_rewrite), Howard Fear (mod_include), - Florent Guillaume (language negotiation). + Howard Fear (mod_include), Florent Guillaume (language negotiation) Many 3rd-party modules, frequently used and recommended, are also freely-available and linked from the related projects page: 1.10 +0 -1 apache-1.2/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.2/CHANGES,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- CHANGES 1997/04/24 23:51:34 1.9 +++ CHANGES 1998/01/30 09:12:40 1.10 @@ -117,7 +117,6 @@ Apache 1.2. Some of the changes visible to users: - Improved FTP proxy supporting PASV mode - - NoProxy directive for excluding sites to proxy - CONNECT mode ports are configurable from a list - NoCache * directive for disabling proxy caching - Numerous bug fixes 1.10 +16 -0 apache-1.2/KEYS Index: KEYS === RCS file
cvs commit: apache-1.2/logs .cvsignore
dgaudet 98/01/30 01:18:12 Added: logs .cvsignore Log: messed this one up Revision ChangesPath 1.1 apache-1.2/logs/.cvsignore Index: .cvsignore === access_log error_log httpd.pid
cvs commit: apache-1.3/src/main http_core.c
dgaudet 98/01/30 11:30:35 Modified:.STATUS src CHANGES src/main http_core.c Log: Fix Options and AllowOverrides merging in main_server lookup_defaults and vhost lookup_defaults. Revision ChangesPath 1.138 +1 -0 apache-1.3/STATUS Index: STATUS === RCS file: /export/home/cvs/apache-1.3/STATUS,v retrieving revision 1.137 retrieving revision 1.138 diff -u -r1.137 -r1.138 --- STATUS1998/01/30 14:51:49 1.137 +++ STATUS1998/01/30 19:30:30 1.138 @@ -142,6 +142,7 @@ * some rfc2068 case insensitivity issues * r-allowed cleanup * References to undefined 'cwd' cell fixed in suexec.c +* fix options/allowoverride merging Available Patches: 1.607 +6 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.606 retrieving revision 1.607 diff -u -r1.606 -r1.607 --- CHANGES 1998/01/30 14:49:55 1.606 +++ CHANGES 1998/01/30 19:30:31 1.607 @@ -1,5 +1,11 @@ Changes with Apache 1.3b4 + *) Options and AllowOverrides weren't properly merging in the main + server setting inside vhosts (only an issue when you have no + Directory or other section containing an Options that affects + a request). Options +foo or -foo in the main_server wouldn't + affect the main_server's lookup defaults. [Dean Gaudet] + *) Variable 'cwd' was being used pointlessly before being set. [Ken Coar] PR#1738 1.153 +21 -10apache-1.3/src/main/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_core.c,v retrieving revision 1.152 retrieving revision 1.153 diff -u -r1.152 -r1.153 --- http_core.c 1998/01/30 03:36:56 1.152 +++ http_core.c 1998/01/30 19:30:34 1.153 @@ -112,9 +112,9 @@ conf-d_is_fnmatch = conf-d ? (is_fnmatch (conf-d) != 0) : 0; conf-d_components = conf-d ? count_dirs (conf-d) : 0; -conf-opts = dir ? OPT_UNSET : OPT_ALL; +conf-opts = dir ? OPT_UNSET : OPT_UNSET|OPT_ALL; conf-opts_add = conf-opts_remove = OPT_NONE; -conf-override = dir ? OR_UNSET : OR_ALL; +conf-override = dir ? OR_UNSET : OR_UNSET|OR_ALL; conf-content_md5 = 2; @@ -158,11 +158,16 @@ conf-d_components = new-d_components; conf-r = new-r; -if (new-opts != OPT_UNSET) conf-opts = new-opts; -if (new-opts_add) conf-opts |= new-opts_add; -if (new-opts_remove) conf-opts = ~(new-opts_remove); +if (!(new-opts OPT_UNSET)) conf-opts = new-opts; +if (new-opts_add) { + conf-opts |= new-opts_add; + conf-opts = ~OPT_UNSET; +} +if (new-opts_remove) { + conf-opts = ~(new-opts_remove | OPT_UNSET); +} -if (new-override != OR_UNSET) conf-override = new-override; +if (!(new-override OR_UNSET)) conf-override = new-override; if (new-default_type) conf-default_type = new-default_type; if (new-auth_type) conf-auth_type = new-auth_type; @@ -692,6 +697,7 @@ d-override = OR_ALL; else return pstrcat (cmd-pool, Illegal override option , w, NULL); + d-override = ~OR_UNSET; } return NULL; @@ -737,12 +743,17 @@ else return pstrcat (cmd-pool, Illegal option , w, NULL); - if (action == '-') + if (action == '-') { d-opts_remove |= opt; - else if (action == '+') + d-opts = ~opt; + } + else if (action == '+') { d-opts_add |= opt; - else - d-opts |= opt; + d-opts |= opt; + } + else { + d-opts |= opt; + } } return NULL;
cvs commit: apache-1.3/src/main http_protocol.c http_request.c
dgaudet 98/01/30 16:15:45 Modified:src/main http_protocol.c http_request.c Log: (Recall: whenever a table's nelts == nalloc and a push is attempted the table size will be doubled, and the old table copied to the new table. It's nice to avoid this if it's easy.) Our default server outputs 8 headers, with the expires module it will do 10 headers. Increase the default r-headers_out table to size 12 to accomodate that (plus a cookie and one other thing). rename_original_environment should use nalloc instead of nelts when selecting a table size. Revision ChangesPath 1.183 +1 -1 apache-1.3/src/main/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.182 retrieving revision 1.183 diff -u -r1.182 -r1.183 --- http_protocol.c 1998/01/28 11:33:21 1.182 +++ http_protocol.c 1998/01/31 00:15:43 1.183 @@ -786,7 +786,7 @@ r-headers_in = make_table(r-pool, 50); r-subprocess_env = make_table(r-pool, 50); -r-headers_out = make_table(r-pool, 5); +r-headers_out = make_table(r-pool, 12); r-err_headers_out = make_table(r-pool, 5); r-notes = make_table(r-pool, 5); 1.104 +2 -2 apache-1.3/src/main/http_request.c Index: http_request.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_request.c,v retrieving revision 1.103 retrieving revision 1.104 diff -u -r1.103 -r1.104 --- http_request.c1998/01/27 02:41:11 1.103 +++ http_request.c1998/01/31 00:15:44 1.104 @@ -1162,7 +1162,7 @@ { array_header *env_arr = table_elts(t); table_entry *elts = (table_entry *) env_arr-elts; -table *new = make_table(p, env_arr-nelts); +table *new = make_table(p, env_arr-nalloc); int i; for (i = 0; i env_arr-nelts; ++i) { @@ -1217,7 +1217,7 @@ new-main= r-main; new-headers_in = r-headers_in; -new-headers_out = make_table(r-pool, 5); +new-headers_out = make_table(r-pool, 12); new-err_headers_out = r-err_headers_out; new-subprocess_env = rename_original_env(r-pool, r-subprocess_env); new-notes = make_table(r-pool, 5);
cvs commit: apache-1.3/src/main alloc.c
dgaudet 98/01/30 16:24:33 Modified:src CHANGES src/main alloc.c Log: People are challenging me to write something in assembly... well gcc is so nice that I don't have to do this one in assembly. MAKE_TABLE_PROFILE is a debugging mode that makes it easier to find tables which are created with too small an initial guess. It uses __builtin_return_address() which is a gcc directive that avoids the need for arch specific assembly to find the return address of the function you're in... super ultra cool for debugging. Revision ChangesPath 1.608 +6 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.607 retrieving revision 1.608 diff -u -r1.607 -r1.608 --- CHANGES 1998/01/30 19:30:31 1.607 +++ CHANGES 1998/01/31 00:24:29 1.608 @@ -1,5 +1,11 @@ Changes with Apache 1.3b4 + *) Tweaked the headers_out table size, and the subprocess_env + table size guess in rename_original_environment(). Added + MAKE_TABLE_PROFILE which can help discover make_table() + calls that use too small an initial guess, see alloc.c. + [Dean Gaudet] + *) Options and AllowOverrides weren't properly merging in the main server setting inside vhosts (only an issue when you have no Directory or other section containing an Options that affects 1.73 +37 -7 apache-1.3/src/main/alloc.c Index: alloc.c === RCS file: /export/home/cvs/apache-1.3/src/main/alloc.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- alloc.c 1998/01/27 10:04:35 1.72 +++ alloc.c 1998/01/31 00:24:32 1.73 @@ -97,6 +97,17 @@ */ /* #define POOL_DEBUG */ +/* Provide diagnostic information about make_table() calls which are + * possibly too small. This requires a recent gcc which supports + * __builtin_return_address(). The error_log output will be a + * message such as: + *table_push: table created by 0x804d874 hit limit of 10 + * Use l *0x804d874 to find the source that corresponds to. It + * indicates that a table allocated by a call at that address has + * possibly too small an initial table size guess. + */ +/* #define MAKE_TABLE_PROFILE */ + #ifdef POOL_DEBUG #ifdef ALLOC_USE_MALLOC # error sorry, no support for ALLOC_USE_MALLOC and POOL_DEBUG at the same time @@ -113,7 +124,6 @@ #define BLOCK_MINALLOC 0 #endif - /* * * Managing free storage blocks... @@ -890,14 +900,34 @@ * cases they do this for. */ array_header a; +#ifdef MAKE_TABLE_PROFILE +void *creator; +#endif }; +#ifdef MAKE_TABLE_PROFILE +static table_entry *table_push(table *t) +{ +if (t-a.nelts == t-a.nalloc) { + fprintf(stderr, + table_push: table created by %p hit limit of %u\n, + t-creator, t-a.nalloc); +} +return (table_entry *) push_array(t-a); +} +#else +#define table_push(t)((table_entry *) push_array((t)-a)) +#endif + API_EXPORT(table *) make_table(pool *p, int nelts) { table *t = palloc(p, sizeof(table)); make_array_core(t-a, p, nelts, sizeof(table_entry)); +#ifdef MAKE_TABLE_PROFILE +t-creator = __builtin_return_address(0); +#endif return t; } @@ -967,7 +997,7 @@ } if (!done) { - elts = (table_entry *) push_array(t-a); + elts = (table_entry *) table_push(t); elts-key = pstrdup(t-a.pool, key); elts-val = pstrdup(t-a.pool, val); } @@ -1013,7 +1043,7 @@ } if (!done) { - elts = (table_entry *) push_array(t-a); + elts = (table_entry *) table_push(t); elts-key = key; elts-val = val; } @@ -1055,7 +1085,7 @@ return; } -elts = (table_entry *) push_array(t-a); +elts = (table_entry *) table_push(t); elts-key = pstrdup(t-a.pool, key); elts-val = pstrdup(t-a.pool, val); } @@ -1085,7 +1115,7 @@ } } -elts = (table_entry *) push_array(t-a); +elts = (table_entry *) table_push(t); elts-key = key; elts-val = val; } @@ -1094,7 +1124,7 @@ { table_entry *elts = (table_entry *) t-a.elts; -elts = (table_entry *) push_array(t-a); +elts = (table_entry *) table_push(t); elts-key = pstrdup(t-a.pool, key); elts-val = pstrdup(t-a.pool, val); } @@ -1116,7 +1146,7 @@ } #endif -elts = (table_entry *) push_array(t-a); +elts = (table_entry *) table_push(t); elts-key = key; elts-val = val; }
cvs commit: apache-1.2/src http_protocol.c
dgaudet 98/01/31 18:22:30 Modified:src http_protocol.c Log: The last commit contained changes it shouldn't have. Reverse them. Revision ChangesPath 1.129 +31 -112 apache-1.2/src/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.2/src/http_protocol.c,v retrieving revision 1.128 retrieving revision 1.129 diff -u -r1.128 -r1.129 --- http_protocol.c 1998/01/30 09:55:41 1.128 +++ http_protocol.c 1998/02/01 02:22:28 1.129 @@ -548,15 +548,13 @@ } } -const char *check_fulluri (request_rec *r, const char *uri) -{ +const char *check_fulluri (request_rec *r, const char *uri) { char *name, *host; int i; unsigned port; - server_addr_rec * sar; /* This routine parses full URLs, if they match the server */ - if (strncasecmp(uri, http://;, 7)) return uri; + if (strncmp(uri, http://;, 7)) return uri; name = pstrdup(r-pool, uri + 7); /* Find the hostname, assuming a valid request */ @@ -569,13 +567,7 @@ else port = 80; /* Make sure ports patch */ - if (port != r-server-port) { -for (sar = r-server-addrs; sar; sar = sar-next) { - if( (sar-host_port == 0) || (port == sar-host_port) ) -break; -} -if (!sar) return uri; - } + if (port != r-server-port) return uri; /* Save it for later use */ r-hostname = pstrdup(r-pool, host); @@ -686,29 +678,15 @@ } } -#define ADDR_MATCHES(addr1,addr2) \ - (addr1.s_addr == addr2.s_addr) || (addr1.s_addr == htonl(INADDR_ANY)) \ -|| (addr1.s_addr == DEFAULT_VHOST_ADDR) - -static void check_hostalias (request_rec *r) -{ +static void check_hostalias (request_rec *r) { const char *hostname=r-hostname; char *host = getword(r-pool, hostname, ':'); /* Get rid of port */ unsigned port = (*hostname) ? atoi(hostname) : 80; - server_rec *s = r-server; - server_addr_rec * sar; + server_rec *s; int l; -/* make sure the client can't spoof the port; - * have to check all possiblities to see if the server - * should be listening. */ - if (port != r-server-port) { -for (sar = s-addrs; sar; sar = sar-next) { - if ( (port == sar-host_port) || (sar-host_port == 0) ) -break; -} -if (!sar) return; - } + if (port (port != r-server-port)) +return; l = strlen(host)-1; if ((host[l]) == '.') { @@ -726,68 +704,37 @@ configuration */ continue; } -/* ok, now there are several possibilities, and we're matching the - * hostname, the port, and r-connection-local_addr. The last is - * required so as to only respond on an address to which this vhost - * should actually be listening. - * - * Either we can match s-server_name and s-port while matching - * against the ip address in a record in the s-addrs list *or* we - * can match s-server_name and a complete record in the s-addrs - * list *or* we can match the virtual host name and the address and - * the port of a record in the s-addrs list. - */ -if (!strcasecmp(host,s-server_hostname)) { /* ServerName matches hostname */ - if (port == s-port) { /* possibly configured by Port */ -for (sar = s-addrs; sar; sar = sar-next) { - if (ADDR_MATCHES(sar-host_addr,r-connection-local_addr.sin_addr)) -break; /* SN matches, Port matches, and one IP addr matches */ -} - } else { /* check to see if an addr matches */ -for (sar = s-addrs; sar; sar = sar-next) { - if (((port == sar-host_port) || (sar-host_port == 0)) - (ADDR_MATCHES(sar-host_addr, - r-connection-local_addr.sin_addr))) -break; /* SN matches, and a addr matches IP port */ -} - } - if (sar) { /* we got a match */ -r-server = r-connection-server = s; -if (r-hostlen !strncasecmp(r-uri, http://;, 7)) { - r-uri += r-hostlen; - parse_uri(r, r-uri); - /* we still might want to do something below (ie. set r-proxyreq) */ -} + +if ((!strcasecmp(host, s-server_hostname)) (port == s-port)) { + r-server = r-connection-server = s; + if (r-hostlen !strncmp(r-uri, http://;, 7)) { + r-uri += r-hostlen; + parse_uri(r, r-uri); } -} /* ServerName doesn't match */ +} -/* now s-addrs list, include the names, from the VirtualHost directive */ -for (sar = s-addrs; sar; sar = sar-next) { - if (((sar-host_port==0) || (port==sar-host_port)) - (ADDR_MATCHES(sar-host_addr,r-connection-local_addr.sin_addr)) - !strcasecmp(host,sar-virthost)) { -/* ok, an element
cvs commit: apache-1.2/src CHANGES http_core.c mod_asis.c mod_dir.c mod_include.c mod_info.c
dgaudet 98/01/31 18:33:42 Modified:src CHANGES http_core.c mod_asis.c mod_dir.c mod_include.c mod_info.c Log: set r-allowed properly Revision ChangesPath 1.289 +3 -0 apache-1.2/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.2/src/CHANGES,v retrieving revision 1.288 retrieving revision 1.289 diff -u -r1.288 -r1.289 --- CHANGES 1998/01/30 14:45:45 1.288 +++ CHANGES 1998/02/01 02:33:36 1.289 @@ -1,5 +1,8 @@ Changes with Apache 1.2.6 + *) Set r-allowed properly in mod_asis.c, mod_dir.c, mod_info.c, + and mod_include.c. [Dean Gaudet] + *) Variable 'cwd' was being used pointlessly before being set. [Ken Coar] PR#1738 1.83 +1 -2 apache-1.2/src/http_core.c Index: http_core.c === RCS file: /export/home/cvs/apache-1.2/src/http_core.c,v retrieving revision 1.82 retrieving revision 1.83 diff -u -r1.82 -r1.83 --- http_core.c 1998/01/30 09:13:55 1.82 +++ http_core.c 1998/02/01 02:33:36 1.83 @@ -1332,8 +1332,7 @@ if ((errstatus = discard_request_body(r)) != OK) return errstatus; -r-allowed |= (1 M_GET); -r-allowed |= (1 M_OPTIONS); +r-allowed |= (1 M_GET) | (1 M_OPTIONS); if (r-method_number == M_INVALID) { log_printf(r-server, Invalid method in request %s, r-the_request); 1.14 +1 -0 apache-1.2/src/mod_asis.c Index: mod_asis.c === RCS file: /export/home/cvs/apache-1.2/src/mod_asis.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- mod_asis.c1997/04/06 07:43:40 1.13 +++ mod_asis.c1998/02/01 02:33:37 1.14 @@ -63,6 +63,7 @@ FILE *f; char *location; +r-allowed |= (1 M_GET); if (r-method_number != M_GET) return DECLINED; if (r-finfo.st_mode == 0) { log_reason(File does not exist, r-filename, r); 1.28 +1 -0 apache-1.2/src/mod_dir.c Index: mod_dir.c === RCS file: /export/home/cvs/apache-1.2/src/mod_dir.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- mod_dir.c 1998/01/30 09:14:04 1.27 +++ mod_dir.c 1998/02/01 02:33:38 1.28 @@ -872,6 +872,7 @@ if (error_notfound) return error_notfound; +r-allowed |= (1 M_GET); if (r-method_number != M_GET) return NOT_IMPLEMENTED; /* OK, nothing easy. Trot out the heavy artillery... */ 1.35 +1 -0 apache-1.2/src/mod_include.c Index: mod_include.c === RCS file: /export/home/cvs/apache-1.2/src/mod_include.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- mod_include.c 1998/01/30 09:14:05 1.34 +++ mod_include.c 1998/02/01 02:33:38 1.35 @@ -2204,6 +2204,7 @@ if (!(allow_options(r) OPT_INCLUDES)) { return DECLINED; } +r-allowed |= (1 M_GET); if (r-method_number != M_GET) { return DECLINED; } 1.18 +5 -1 apache-1.2/src/mod_info.c Index: mod_info.c === RCS file: /export/home/cvs/apache-1.2/src/mod_info.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- mod_info.c1998/01/30 09:14:06 1.17 +++ mod_info.c1998/02/01 02:33:39 1.18 @@ -282,11 +282,15 @@ extern char server_root[MAX_STRING_LEN]; extern char server_confname[MAX_STRING_LEN]; + r-allowed |= (1 M_GET); + if (r-method_number != M_GET) + return DECLINED; + r-content_type = text/html; send_http_header(r); if(r-header_only) { return 0; -} + } hard_timeout(send server info, r); rputs(htmlheadtitleServer Information/title/head\n,r);
cvs commit: apache-1.2/src/modules/proxy mod_proxy.c
dgaudet 98/01/31 18:47:46 Modified:src CHANGES http_config.c http_protocol.c mod_cgi.c mod_dir.c mod_rewrite.c util.c src/modules/proxy mod_proxy.c Log: be sensitive to the case! Revision ChangesPath 1.290 +3 -0 apache-1.2/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.2/src/CHANGES,v retrieving revision 1.289 retrieving revision 1.290 diff -u -r1.289 -r1.290 --- CHANGES 1998/02/01 02:33:36 1.289 +++ CHANGES 1998/02/01 02:47:37 1.290 @@ -1,5 +1,8 @@ Changes with Apache 1.2.6 + *) Fixed some case-sensitivity issues according to RFC2068. + [Dean Gaudet] + *) Set r-allowed properly in mod_asis.c, mod_dir.c, mod_info.c, and mod_include.c. [Dean Gaudet] 1.51 +1 -1 apache-1.2/src/http_config.c Index: http_config.c === RCS file: /export/home/cvs/apache-1.2/src/http_config.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- http_config.c 1998/01/30 09:13:53 1.50 +++ http_config.c 1998/02/01 02:47:38 1.51 @@ -883,7 +883,7 @@ if (strcmp(w, *) == 0) { my_addr = htonl(INADDR_ANY); is_an_ip_addr = 1; -} else if( strcmp(w, _default_) == 0 +} else if( strcasecmp(w, _default_) == 0 || strcmp(w, 255.255.255.255) == 0 ) { my_addr = DEFAULT_VHOST_ADDR; is_an_ip_addr = 1; 1.130 +1 -1 apache-1.2/src/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache-1.2/src/http_protocol.c,v retrieving revision 1.129 retrieving revision 1.130 diff -u -r1.129 -r1.130 --- http_protocol.c 1998/02/01 02:22:28 1.129 +++ http_protocol.c 1998/02/01 02:47:39 1.130 @@ -129,7 +129,7 @@ if (!(range = table_get(r-headers_in, Range))) range = table_get(r-headers_in, Request-Range); -if (!range || strncmp(range, bytes=, 6)) { +if (!range || strncasecmp(range, bytes=, 6)) { table_set (r-headers_out, Accept-Ranges, bytes); return 0; } 1.41 +1 -1 apache-1.2/src/mod_cgi.c Index: mod_cgi.c === RCS file: /export/home/cvs/apache-1.2/src/mod_cgi.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- mod_cgi.c 1998/01/30 09:14:03 1.40 +++ mod_cgi.c 1998/02/01 02:47:40 1.41 @@ -84,7 +84,7 @@ int is_scriptaliased (request_rec *r) { char *t = table_get (r-notes, alias-forced-type); -return t (!strcmp (t, cgi-script)); +return t (!strcasecmp (t, cgi-script)); } /* Configuration stuff */ 1.29 +1 -1 apache-1.2/src/mod_dir.c Index: mod_dir.c === RCS file: /export/home/cvs/apache-1.2/src/mod_dir.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- mod_dir.c 1998/02/01 02:33:38 1.28 +++ mod_dir.c 1998/02/01 02:47:40 1.29 @@ -481,7 +481,7 @@ if (r-status != HTTP_OK) { return NULL; } -if (r-content_type !strcmp(r-content_type,text/html) !r-content_encoding) { +if (r-content_type !strcasecmp(r-content_type,text/html) !r-content_encoding) { if(!(thefile = pfopen(r-pool, r-filename,r))) return NULL; n = fread(titlebuf,sizeof(char),MAX_STRING_LEN - 1,thefile); 1.30 +19 -19apache-1.2/src/mod_rewrite.c Index: mod_rewrite.c === RCS file: /export/home/cvs/apache-1.2/src/mod_rewrite.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- mod_rewrite.c 1998/01/30 09:14:08 1.29 +++ mod_rewrite.c 1998/02/01 02:47:41 1.30 @@ -947,13 +947,13 @@ return OK; } else if ( (strlen(r-filename) 7 -strncmp(r-filename, http://;, 7) == 0) +strncasecmp(r-filename, http://;, 7) == 0) || (strlen(r-filename) 8 -strncmp(r-filename, https://;, 8) == 0) +strncasecmp(r-filename, https://;, 8) == 0) || (strlen(r-filename) 9 -strncmp(r-filename, gopher://;, 9) == 0) +strncasecmp(r-filename, gopher://;, 9) == 0) || (strlen(r-filename) 6 -strncmp(r-filename, ftp://;, 6) == 0)) { +strncasecmp(r-filename, ftp://;, 6) == 0)) { /* it was finally rewritten
cvs commit: apache-1.3/src/main http_vhost.c
dgaudet 98/01/31 20:54:48 Modified:src CHANGES src/main http_vhost.c Log: Fix a bug I introduced with http_vhost.c... r-hostname is supposed to always have :port removed from it. Revision ChangesPath 1.609 +3 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.608 retrieving revision 1.609 diff -u -r1.608 -r1.609 --- CHANGES 1998/01/31 00:24:29 1.608 +++ CHANGES 1998/02/01 04:54:45 1.609 @@ -1,5 +1,8 @@ Changes with Apache 1.3b4 + *) Fix a bug where r-hostname didn't have the :port stripped + from it. [Dean Gaudet] + *) Tweaked the headers_out table size, and the subprocess_env table size guess in rename_original_environment(). Added MAKE_TABLE_PROFILE which can help discover make_table() 1.5 +23 -11apache-1.3/src/main/http_vhost.c Index: http_vhost.c === RCS file: /export/home/cvs/apache-1.3/src/main/http_vhost.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- http_vhost.c 1998/01/28 11:33:22 1.4 +++ http_vhost.c 1998/02/01 04:54:47 1.5 @@ -587,6 +587,24 @@ * run-time vhost matching functions */ +/* Remove :port and optionally a single trailing . from the hostname, this + * canonicalizes it somewhat. + */ +static void fix_hostname(request_rec *r) +{ +const char *hostname = r-hostname; +char *host = getword(r-pool, hostname, ':'); /* get rid of port */ +size_t l; + +/* trim a trailing . */ +l = strlen(host); +if (l 0 host[l-1] == '.') { +host[l-1] = '\0'; +} + +r-hostname = host; +} + static void check_hostalias(request_rec *r) { /* @@ -602,21 +620,12 @@ * - except for the addresses from the VirtualHost line, none of the other * names we'll match have ports associated with them */ -const char *hostname = r-hostname; -char *host = getword(r-pool, hostname, ':'); /* Get rid of port */ +const char *host = r-hostname; unsigned port = ntohs(r-connection-local_addr.sin_port); server_rec *s; server_rec *last_s; -size_t l; name_chain *src; -/* trim a trailing . */ -l = strlen(host); -if (l 0 host[l-1] == '.') { -host[l-1] = '\0'; -} - -r-hostname = host; last_s = NULL; /* Recall that the name_chain is a list of server_addr_recs, some of @@ -730,14 +739,17 @@ { /* check if we tucked away a name_chain */ if (r-connection-vhost_lookup_data) { -if (r-hostname || (r-hostname = table_get(r-headers_in, Host))) +if (r-hostname || (r-hostname = table_get(r-headers_in, Host))) { + fix_hostname(r); check_hostalias(r); + } else check_serverpath(r); } else if (!r-hostname) { /* must set this for HTTP/1.1 support */ r-hostname = table_get(r-headers_in, Host); + fix_hostname(r); } }
cvs commit: apache-1.3/src/include alloc.h
dgaudet 98/02/01 12:54:46 Modified:src/main alloc.c src/include alloc.h Log: the new table_xxxn() API should use const char * pointers Revision ChangesPath 1.74 +10 -10apache-1.3/src/main/alloc.c Index: alloc.c === RCS file: /export/home/cvs/apache-1.3/src/main/alloc.c,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- alloc.c 1998/01/31 00:24:32 1.73 +++ alloc.c 1998/02/01 20:54:44 1.74 @@ -1003,7 +1003,7 @@ } } -API_EXPORT(void) table_setn(table *t, char *key, char *val) +API_EXPORT(void) table_setn(table *t, const char *key, const char *val) { register int i, j, k; table_entry *elts = (table_entry *) t-a.elts; @@ -1025,7 +1025,7 @@ for (i = 0; i t-a.nelts; ) { if (!strcasecmp(elts[i].key, key)) { if (!done) { - elts[i].val = val; + elts[i].val = (char *)val; done = 1; ++i; } @@ -1044,8 +1044,8 @@ if (!done) { elts = (table_entry *) table_push(t); - elts-key = key; - elts-val = val; + elts-key = (char *)key; + elts-val = (char *)val; } } @@ -1090,7 +1090,7 @@ elts-val = pstrdup(t-a.pool, val); } -API_EXPORT(void) table_mergen(table *t, char *key, char *val) +API_EXPORT(void) table_mergen(table *t, const char *key, const char *val) { table_entry *elts = (table_entry *) t-a.elts; int i; @@ -1116,8 +1116,8 @@ } elts = (table_entry *) table_push(t); -elts-key = key; -elts-val = val; +elts-key = (char *)key; +elts-val = (char *)val; } API_EXPORT(void) table_add(table *t, const char *key, const char *val) @@ -1129,7 +1129,7 @@ elts-val = pstrdup(t-a.pool, val); } -API_EXPORT(void) table_addn(table *t, char *key, char *val) +API_EXPORT(void) table_addn(table *t, const char *key, const char *val) { table_entry *elts = (table_entry *) t-a.elts; @@ -1147,8 +1147,8 @@ #endif elts = (table_entry *) table_push(t); -elts-key = key; -elts-val = val; +elts-key = (char *)key; +elts-val = (char *)val; } API_EXPORT(table *) overlay_tables(pool *p, const table *overlay, const table *base) 1.45 +3 -3 apache-1.3/src/include/alloc.h Index: alloc.h === RCS file: /export/home/cvs/apache-1.3/src/include/alloc.h,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- alloc.h 1998/01/27 10:00:40 1.44 +++ alloc.h 1998/02/01 20:54:45 1.45 @@ -164,12 +164,12 @@ API_EXPORT(void) clear_table(table *); API_EXPORT(char *) table_get(const table *, const char *); API_EXPORT(void) table_set(table *, const char *name, const char *val); -API_EXPORT(void) table_setn(table *, char *name, char *val); +API_EXPORT(void) table_setn(table *, const char *name, const char *val); API_EXPORT(void) table_merge(table *, const char *name, const char *more_val); -API_EXPORT(void) table_mergen(table *, char *name, char *more_val); +API_EXPORT(void) table_mergen(table *, const char *name, const char *more_val); API_EXPORT(void) table_unset(table *, const char *key); API_EXPORT(void) table_add(table *, const char *name, const char *val); -API_EXPORT(void) table_addn(table *, char *name, char *val); +API_EXPORT(void) table_addn(table *, const char *name, const char *val); API_EXPORT(void) table_do(int (*comp) (void *, const char *, const char *), void *rec, const table *t,...);
cvs commit: apache-1.3/src/modules/standard mod_dir.c mod_imap.c mod_rewrite.c mod_speling.c
dgaudet 98/02/01 14:05:44 Modified:conf httpd.conf-dist httpd.conf-dist-win htdocs/manual new_features_1_3.html htdocs/manual/mod core.html src CHANGES src/include http_config.h http_core.h httpd.h src/main http_core.c util.c util_script.c src/modules/standard mod_dir.c mod_imap.c mod_rewrite.c mod_speling.c Log: Add the UseCanonicalName directive which controls how self-referential redirects are generated. This was at least approved in spirit by a handful of folks two weeks ago. The default should be no behaviour change. This changes the prototype of construct_url(), and adds two new API functions: get_server_name() and get_server_port(). So the MODULE_MAGIC_NUMBER has been bumped. PR: 315, 459, 485, 1433 Submitted by: Michael Douglass [EMAIL PROTECTED], Dean Gaudet Revision ChangesPath 1.19 +8 -0 apache-1.3/conf/httpd.conf-dist Index: httpd.conf-dist === RCS file: /export/home/cvs/apache-1.3/conf/httpd.conf-dist,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- httpd.conf-dist 1997/12/22 21:39:58 1.18 +++ httpd.conf-dist 1998/02/01 22:05:26 1.19 @@ -92,6 +92,14 @@ #ServerName new.host.name +# UseCanonicalName: (new for 1.3) With this setting turned on, whenever +# Apache needs to construct a self-referencing URL (a url that refers back +# to the server the response is coming from) it will use ServerName and +# Port to form a canonical name. With this setting off, Apache will +# use the hostname:port that the client supplied, when possible. This +# also affects SERVER_NAME and SERVER_PORT in CGIs. +UseCanonicalName on + # CacheNegotiatedDocs: By default, Apache sends Pragma: no-cache with each # document that was negotiated on the basis of content. This asks proxy # servers not to cache the document. Uncommenting the following line disables 1.8 +8 -0 apache-1.3/conf/httpd.conf-dist-win Index: httpd.conf-dist-win === RCS file: /export/home/cvs/apache-1.3/conf/httpd.conf-dist-win,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- httpd.conf-dist-win 1997/11/21 15:39:32 1.7 +++ httpd.conf-dist-win 1998/02/01 22:05:27 1.8 @@ -79,6 +79,14 @@ #ServerName new.host.name +# UseCanonicalName: (new for 1.3) With this setting turned on, whenever +# Apache needs to construct a self-referencing URL (a url that refers back +# to the server the response is coming from) it will use ServerName and +# Port to form a canonical name. With this setting off, Apache will +# use the hostname:port that the client supplied, when possible. This +# also affects SERVER_NAME and SERVER_PORT in CGIs. +UseCanonicalName on + # CacheNegotiatedDocs: By default, Apache sends Pragma: no-cache with each # document that was negotiated on the basis of content. This asks proxy # servers not to cache the document. Uncommenting the following line disables 1.41 +19 -0 apache-1.3/htdocs/manual/new_features_1_3.html Index: new_features_1_3.html === RCS file: /export/home/cvs/apache-1.3/htdocs/manual/new_features_1_3.html,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- new_features_1_3.html 1998/01/30 09:35:54 1.40 +++ new_features_1_3.html 1998/02/01 22:05:28 1.41 @@ -480,6 +480,15 @@ also some debugging support to ensure code uses them properly. See codesrc/CHANGES/code for more information. +listrongcodeconstruct_url/code/strongbr +The function prototype for this changed from taking a +codeserver_rec */code to taking a coderequest_rec */code. + +listrongcodeget_server_name/code, codeget_server_port/code/strongbr +These are wrappers which deal with the +a href=mod/core.html#usecanonicalnameUseCanonicalName/a directive +when retrieving the server name and port for a request. + /UL LISTRONGYear-2000 Improvements/STRONG @@ -518,6 +527,16 @@ to tell which server produced the error message, especially in a proxy chain (often found in intranet environments). /LI + + listrongNew sampa href=mod/core.html#usecanonicalnameUseCanonicalName/a/samp directive/strong + br + This directive gives control over how Apache creates self-referential URLs. + Previously Apache would always use the a href=mod/core.html#servername + ServerName/a and a href=mod/core.html#portPort/a directives to + construct a canonical name for the server. With sampUseCanonicalName
cvs commit: apache-devsite mmn.txt
dgaudet 98/02/01 14:07:00 Modified:.mmn.txt Log: update to 19980201 Revision ChangesPath 1.9 +2 -0 apache-devsite/mmn.txt Index: mmn.txt === RCS file: /export/home/cvs/apache-devsite/mmn.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- mmn.txt 1998/01/26 19:52:44 1.8 +++ mmn.txt 1998/02/01 22:07:00 1.9 @@ -27,3 +27,5 @@ 19971026 (1.3b3-dev) - custom config hooks in place 19980126 (1.3b4-dev) - ap_cpystrn() - table_addn(), table_setn(), table_mergen() +19980201 (1.3b4-dev) - construct_url() prototype server_rec * - request_rec * + - add get_server_name() and get_server_port()