httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-2.0/server core.c
Date Sun, 14 Mar 2004 16:24:55 GMT
nd          2004/03/14 08:24:55

  Modified:    .        CHANGES
               include  http_core.h
               server   core.c
  Log:
  Satisfy directives now can be influenced by a surrounding <Limit>
  container.
  
  PR: 14726.
  
  Revision  Changes    Path
  1.1424    +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1423
  retrieving revision 1.1424
  diff -u -u -r1.1423 -r1.1424
  --- CHANGES	13 Mar 2004 22:18:18 -0000	1.1423
  +++ CHANGES	14 Mar 2004 16:24:55 -0000	1.1424
  @@ -2,6 +2,9 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) Satisfy directives now can be influenced by a surrounding <Limit>
  +     container.  PR 14726.  [André Malo]
  +
     *) htpasswd: use apr_temp_dir_get() and general cleanup
        [Guenter Knauf <eflash gmx.net>, Thom May]
   
  
  
  
  1.81      +1 -1      httpd-2.0/include/http_core.h
  
  Index: http_core.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/http_core.h,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -u -r1.80 -r1.81
  --- http_core.h	9 Feb 2004 20:38:21 -0000	1.80
  +++ http_core.h	14 Mar 2004 16:24:55 -0000	1.81
  @@ -415,7 +415,7 @@
     
       /* Authentication stuff.  Groan... */
       
  -    int satisfy;
  +    int *satisfy; /* for every method one */
       char *ap_auth_type;
       char *ap_auth_name;
       apr_array_header_t *ap_requires;
  
  
  
  1.266     +20 -6     httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.265
  retrieving revision 1.266
  diff -u -u -r1.265 -r1.266
  --- core.c	11 Mar 2004 03:57:49 -0000	1.265
  +++ core.c	14 Mar 2004 16:24:55 -0000	1.266
  @@ -85,6 +85,7 @@
   static void *create_core_dir_config(apr_pool_t *a, char *dir)
   {
       core_dir_config *conf;
  +    int i;
   
       conf = (core_dir_config *)apr_pcalloc(a, sizeof(core_dir_config));
   
  @@ -100,7 +101,10 @@
       conf->use_canonical_name = USE_CANONICAL_NAME_UNSET;
   
       conf->hostname_lookups = HOSTNAME_LOOKUP_UNSET;
  -    conf->satisfy = SATISFY_NOSPEC;
  +    conf->satisfy = apr_palloc(a, sizeof(*conf->satisfy) * METHODS);
  +    for (i = 0; i < METHODS; ++i) {
  +        conf->satisfy[i] = SATISFY_NOSPEC;
  +    }
   
   #ifdef RLIMIT_CPU
       conf->limit_cpu = NULL;
  @@ -329,8 +333,10 @@
       /* Otherwise we simply use the base->sec_file array
        */
   
  -    if (new->satisfy != SATISFY_NOSPEC) {
  -        conf->satisfy = new->satisfy;
  +    for (i = 0; i < METHODS; ++i) {
  +        if (new->satisfy[i] != SATISFY_NOSPEC) {
  +            conf->satisfy[i] = new->satisfy[i];
  +        }
       }
   
       if (new->server_signature != srv_sig_unset) {
  @@ -662,7 +668,7 @@
       conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
                                                      &core_module);
   
  -    return conf->satisfy;
  +    return conf->satisfy[r->method_number];
   }
   
   /* Should probably just get rid of this... the only code that cares is
  @@ -1479,15 +1485,23 @@
   static const char *satisfy(cmd_parms *cmd, void *c_, const char *arg)
   {
       core_dir_config *c = c_;
  +    int satisfy = SATISFY_NOSPEC;
  +    int i;
   
       if (!strcasecmp(arg, "all")) {
  -        c->satisfy = SATISFY_ALL;
  +        satisfy = SATISFY_ALL;
       }
       else if (!strcasecmp(arg, "any")) {
  -        c->satisfy = SATISFY_ANY;
  +        satisfy = SATISFY_ANY;
       }
       else {
           return "Satisfy either 'any' or 'all'.";
  +    }
  +
  +    for (i = 0; i < METHODS; ++i) {
  +        if (cmd->limited & (AP_METHOD_BIT << i)) {
  +            c->satisfy[i] = satisfy;
  +        }
       }
   
       return NULL;
  
  
  

Mime
View raw message