]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Satisfy directives now can be influenced by a surrounding <Limit>
authorAndré Malo <nd@apache.org>
Thu, 26 Aug 2004 22:16:53 +0000 (22:16 +0000)
committerAndré Malo <nd@apache.org>
Thu, 26 Aug 2004 22:16:53 +0000 (22:16 +0000)
container.

PR: 14726.
Reviewed by: Jeff Trawick, Bill Stoddard

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@104841 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
include/http_core.h
server/core.c

diff --git a/CHANGES b/CHANGES
index 95093a91066092db22d4b073a6ea2f8ea32e131e..d2ddd1d96b60777c7c64e75f594daef5149ddeaa 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 Changes with Apache 2.0.51
 
+  *) Satisfy directives now can be influenced by a surrounding <Limit>
+     container.  PR 14726.  [André Malo]
+
   *) mod_rewrite now officially supports RewriteRules in <Proxy> sections.
      PR 27985.  [André Malo]
 
diff --git a/STATUS b/STATUS
index 0ee3440c3543d3df896da03eaabc07d61144b615..7e9fb931bac3a7dd8966f06b9c354def6fa64a7f 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2004/08/26 21:53:23 $]
+Last modified at [$Date: 2004/08/26 22:16:52 $]
 
 Release:
 
@@ -198,12 +198,6 @@ PATCHES TO BACKPORT FROM 2.1
                       a correctness fix; just a perf. fix.  We'd send the EOS
                       later without it.
 
-    *) Allow Satisfy directives to be influenced by <Limit>.
-       PR: 14726
-         include/http_core.h: r1.81
-         server/core.c: r1.266
-       +1: nd, trawick, stoddard
-
     *) Provide TLS/SSL upgrade functionality in mod_ssl allowing an unsecure
        connection to be upgraded to a secure connection upon request by the
        client.  The full patch file is available at http://www.apache.org/~bnicholes/
index 2e8fb472bccd1564724345596584090f1c639d69..5bbf6a074af4a7e727f25ce0005c5698a28e9493 100644 (file)
@@ -422,7 +422,7 @@ typedef struct {
   
     /* 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;
index 21af7ee0e0a1d20d67a3ea06572546fe5f676684..56dd94d993e38d8dad99c65f5c3861672feb36ac 100644 (file)
@@ -98,6 +98,7 @@ static char errordocument_default;
 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));
 
@@ -114,7 +115,10 @@ static void *create_core_dir_config(apr_pool_t *a, char *dir)
 
     conf->hostname_lookups = HOSTNAME_LOOKUP_UNSET;
     conf->do_rfc1413 = DEFAULT_RFC1413 | 2; /* set bit 1 to indicate default */
-    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;
@@ -347,8 +351,10 @@ static void *merge_core_dir_configs(apr_pool_t *a, void *basev, void *newv)
     /* 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) {
@@ -680,7 +686,7 @@ AP_DECLARE(int) ap_satisfies(request_rec *r)
     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
@@ -1516,17 +1522,25 @@ static const char *set_enable_sendfile(cmd_parms *cmd, void *d_,
 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;
 }