From: André Malo Date: Thu, 26 Aug 2004 22:16:53 +0000 (+0000) Subject: Satisfy directives now can be influenced by a surrounding X-Git-Tag: STRIKER_2_0_51_RC1^2~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d18bc17cdf749c2476972ffde83547f0261bfcb;p=thirdparty%2Fapache%2Fhttpd.git Satisfy directives now can be influenced by a surrounding 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 --- diff --git a/CHANGES b/CHANGES index 95093a91066..d2ddd1d96b6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 2.0.51 + *) Satisfy directives now can be influenced by a surrounding + container. PR 14726. [André Malo] + *) mod_rewrite now officially supports RewriteRules in sections. PR 27985. [André Malo] diff --git a/STATUS b/STATUS index 0ee3440c354..7e9fb931bac 100644 --- 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 . - 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/ diff --git a/include/http_core.h b/include/http_core.h index 2e8fb472bcc..5bbf6a074af 100644 --- a/include/http_core.h +++ b/include/http_core.h @@ -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; diff --git a/server/core.c b/server/core.c index 21af7ee0e0a..56dd94d993e 100644 --- a/server/core.c +++ b/server/core.c @@ -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; }