cvs commit: apache-1.3/src/modules/standard mod_access.c

1999-08-06 Thread dgaudet
dgaudet 99/08/05 18:37:59

  Modified:src  CHANGES
   src/modules/standard mod_access.c
  Log:
  CIDR addresses such as a.b.c.d/24 where d != 0 weren't handled
  properly... mask off the host bits of the address.
  
  PR:   4770
  Submitted by: Paul J. Reder [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.1410+4 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1409
  retrieving revision 1.1410
  diff -u -r1.1409 -r1.1410
  --- CHANGES   1999/08/03 09:27:25 1.1409
  +++ CHANGES   1999/08/06 01:37:56 1.1410
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.8
   
  +  *) CIDR addresses such as a.b.c.d/24 where d != 0 weren't handled
  + properly in mod_access.
  + [Paul J. Reder [EMAIL PROTECTED]] PR#4770
  +
 *) RewriteLock/RewriteMap didn't work properly with virtual hosts.
[Dmitry Khrustalev [EMAIL PROTECTED]] PR#3874
   
  
  
  
  1.39  +1 -1  apache-1.3/src/modules/standard/mod_access.c
  
  Index: mod_access.c
  ===
  RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_access.c,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- mod_access.c  1999/01/01 19:05:06 1.38
  +++ mod_access.c  1999/08/06 01:37:58 1.39
  @@ -202,7 +202,7 @@
mask = htonl(mask);
}
a-x.ip.mask = mask;
  -
  +a-x.ip.net  = (a-x.ip.net  mask);   /* pjr - This fixes PR 4770 */
   }
   else if (ap_isdigit(*where)  is_ip(where)) {
/* legacy syntax for ip addrs: a.b.c. == a.b.c.0/24 for example */
  
  
  


cvs commit: apache-1.3/src/modules/standard mod_access.c

1998-04-19 Thread dgaudet
dgaudet 98/04/19 12:19:39

  Modified:src  CHANGES
   src/ap   ap_snprintf.c
   src/include ap.h
   src/modules/standard mod_access.c
  Log:
  add %pA, %pI, and %pp format codes
  
  Reviewed by:  Martin Kraemer
  
  Revision  ChangesPath
  1.776 +4 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.775
  retrieving revision 1.776
  diff -u -r1.775 -r1.776
  --- CHANGES   1998/04/19 16:03:40 1.775
  +++ CHANGES   1998/04/19 19:19:35 1.776
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3b7
   
  +  *) Add %pA, %pI, and %pp codes to ap_vformatter (and hence ap_bprintf,
  + ap_snprintf, and ap_psprintf).  See include/ap.h for docs.
  + [Dean Gaudet]
  +
 *) Because /usr/local/apache is the default prefix the ``configure
--compat'' option no longer has to set prefix, again. This way the
--compat option honors a leading --prefix option. [Lars Eilebrecht]
  
  
  
  1.19  +119 -37   apache-1.3/src/ap/ap_snprintf.c
  
  Index: ap_snprintf.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/ap/ap_snprintf.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- ap_snprintf.c 1998/03/31 12:52:13 1.18
  +++ ap_snprintf.c 1998/04/19 19:19:36 1.19
  @@ -384,6 +384,43 @@
   
   
   
  +static char *conv_in_addr(struct in_addr *ia, char *buf_end, int *len)
  +{
  +unsigned addr = ntohl(ia-s_addr);
  +char *p = buf_end;
  +bool_int is_negative;
  +int sub_len;
  +
  +p = conv_10((addr  0x00FF)  , TRUE, is_negative, p, sub_len);
  +*--p = '.';
  +p = conv_10((addr  0xFF00)   8, TRUE, is_negative, p, sub_len);
  +*--p = '.';
  +p = conv_10((addr  0x00FF)  16, TRUE, is_negative, p, sub_len);
  +*--p = '.';
  +p = conv_10((addr  0xFF00)  24, TRUE, is_negative, p, sub_len);
  +
  +*len = buf_end - p;
  +return (p);
  +}
  +
  +
  +
  +static char *conv_sockaddr_in(struct sockaddr_in *si, char *buf_end, int 
*len)
  +{
  +char *p = buf_end;
  +bool_int is_negative;
  +int sub_len;
  +
  +p = conv_10(ntohs(si-sin_port), TRUE, is_negative, p, sub_len);
  +*--p = ':';
  +p = conv_in_addr(si-sin_addr, p, sub_len);
  +
  +*len = buf_end - p;
  +return (p);
  +}
  +
  +
  +
   /*
* Convert a floating point number to a string formats 'f', 'e' or 'E'.
* The result is placed in buf, and len denotes the length of the string
  @@ -660,33 +697,27 @@
i_num = va_arg(ap, u_wide_int);
else
i_num = (wide_int) va_arg(ap, unsigned int);
  - /*
  -  * The rest also applies to other integer formats, so fall
  -  * into that case.
  -  */
  + s = conv_10(i_num, 1, is_negative,
  + num_buf[NUM_BUF_SIZE], s_len);
  + FIX_PRECISION(adjust_precision, precision, s, s_len);
  + break;
  +
case 'd':
case 'i':
  - /*
  -  * Get the arg if we haven't already.
  -  */
  - if ((*fmt) != 'u') {
  - if (is_long)
  - i_num = va_arg(ap, wide_int);
  - else
  - i_num = (wide_int) va_arg(ap, int);
  - };
  - s = conv_10(i_num, (*fmt) == 'u', is_negative,
  + if (is_long)
  + i_num = va_arg(ap, wide_int);
  + else
  + i_num = (wide_int) va_arg(ap, int);
  + s = conv_10(i_num, 0, is_negative,
num_buf[NUM_BUF_SIZE], s_len);
FIX_PRECISION(adjust_precision, precision, s, s_len);
   
  - if (*fmt != 'u') {
  - if (is_negative)
  - prefix_char = '-';
  - else if (print_sign)
  - prefix_char = '+';
  - else if (print_blank)
  - prefix_char = ' ';
  - }
  + if (is_negative)
  + prefix_char = '-';
  + else if (print_sign)
  + prefix_char = '+';
  + else if (print_blank)
  + prefix_char = ' ';
break;
   
   
  @@ -801,26 +832,77 @@
break;
   
/*
  -  * Always extract the argument as a char * pointer. We 
  -  * should be using void * but there are still machines 
  -  * that don't understand it.
  -  * If the pointer size is equal to the size of an unsigned
  -  * integer we convert the pointer to a hex number, otherwise 
  -  * we print %p to indicate 

cvs commit: apache-1.3/src/modules/standard mod_access.c mod_actions.c mod_auth_anon.c mod_env.c mod_expires.c mod_headers.c mod_log_referer.c mod_negotiation.c mod_rewrite.c mod_so.c mod_userdir.c mod_usertrack.c

1998-03-12 Thread dgaudet
dgaudet 98/03/12 03:03:10

  Modified:src/modules/standard mod_access.c mod_actions.c
mod_auth_anon.c mod_env.c mod_expires.c
mod_headers.c mod_log_referer.c mod_negotiation.c
mod_rewrite.c mod_so.c mod_userdir.c
mod_usertrack.c
  Log:
  Waste less memory.  I didn't really put a lot of effort into savings in
  mod_rewrite or mod_autoindex.
  
  Revision  ChangesPath
  1.31  +1 -1  apache-1.3/src/modules/standard/mod_access.c
  
  Index: mod_access.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_access.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- mod_access.c  1998/01/28 11:33:25 1.30
  +++ mod_access.c  1998/03/12 11:02:59 1.31
  @@ -149,7 +149,7 @@
return allow and deny must be followed by 'from';
   
   a = (allowdeny *) push_array(cmd-info ? d-allows : d-denys);
  -a-x.from = where = pstrdup(cmd-pool, where);
  +a-x.from = where;
   a-limited = cmd-limited;
   
   if (!strncasecmp(where, env=, 4)) {
  
  
  
  1.22  +4 -4  apache-1.3/src/modules/standard/mod_actions.c
  
  Index: mod_actions.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_actions.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- mod_actions.c 1998/01/07 16:46:42 1.21
  +++ mod_actions.c 1998/03/12 11:02:59 1.22
  @@ -129,13 +129,13 @@
  char *script)
   {
   if (!strcmp(method, GET))
  - m-get = pstrdup(cmd-pool, script);
  + m-get = script;
   else if (!strcmp(method, POST))
  - m-post = pstrdup(cmd-pool, script);
  + m-post = script;
   else if (!strcmp(method, PUT))
  - m-put = pstrdup(cmd-pool, script);
  + m-put = script;
   else if (!strcmp(method, DELETE))
  - m-delete = pstrdup(cmd-pool, script);
  + m-delete = script;
   else
return Unknown method type for Script;
   
  
  
  
  1.30  +1 -1  apache-1.3/src/modules/standard/mod_auth_anon.c
  
  Index: mod_auth_anon.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_auth_anon.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- mod_auth_anon.c   1998/01/07 16:46:44 1.29
  +++ mod_auth_anon.c   1998/03/12 11:03:01 1.30
  @@ -177,7 +177,7 @@
   
   if (
   (!(sec-auth_anon_passwords = (auth_anon *) palloc(cmd-pool, 
sizeof(auth_anon ||
  -   (!(sec-auth_anon_passwords-password = pstrdup(cmd-pool, arg)))
  +   (!(sec-auth_anon_passwords-password = arg))
   )
 return Failed to claim memory for an anonymous password...;
   
  
  
  
  1.20  +4 -4  apache-1.3/src/modules/standard/mod_env.c
  
  Index: mod_env.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_env.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- mod_env.c 1998/01/24 19:00:24 1.19
  +++ mod_env.c 1998/03/12 11:03:01 1.20
  @@ -145,7 +145,7 @@
   elts = (table_entry *)arr-elts;
   
   for (i = 0; i  arr-nelts; ++i) {
  -table_set(new_table, elts[i].key, elts[i].val);
  +table_setn(new_table, elts[i].key, elts[i].val);
   }
   
   unset = add-unsetenv;
  @@ -176,7 +176,7 @@
   env_var = getenv(name_ptr);
   if (env_var != NULL) {
   sconf-vars_present = 1;
  -table_set(vars, name_ptr, env_var);
  +table_setn(vars, name_ptr, pstrdup(cmd-pool, env_var));
   }
   }
   return NULL;
  @@ -203,7 +203,7 @@
   }
   
   sconf-vars_present = 1;
  -table_set(vars, name, value);
  +table_setn(vars, name, value);
   
   return NULL;
   }
  @@ -215,7 +215,7 @@
   get_module_config(cmd-server-module_config, env_module);
   sconf-unsetenv = sconf-unsetenv ?
   pstrcat(cmd-pool, sconf-unsetenv,  , arg, NULL) :
  - pstrdup(cmd-pool, arg);
  + arg;
   return NULL;
   }
   
  
  
  
  1.23  +3 -3  apache-1.3/src/modules/standard/mod_expires.c
  
  Index: mod_expires.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_expires.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- mod_expires.c 1998/01/26 19:50:20 1.22
  +++ mod_expires.c 1998/03/12 11:03:02 1.23
  @@ -247,7 +247,7 @@
   /* 0.0.4 compatibility?
*/
   if ((code[0] == 'A') || (code[0] == 'M')) {
  -*real_code = pstrdup(p, 

cvs commit: apache-1.3/src/modules/standard mod_access.c mod_autoindex.c mod_cgi.c mod_include.c mod_rewrite.c

1998-01-28 Thread dgaudet
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? */