Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 96304 invoked from network); 14 Mar 2004 16:24:57 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 14 Mar 2004 16:24:57 -0000 Received: (qmail 9773 invoked by uid 500); 14 Mar 2004 16:24:51 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 9585 invoked by uid 500); 14 Mar 2004 16:24:50 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 9571 invoked by uid 500); 14 Mar 2004 16:24:50 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Received: (qmail 9567 invoked from network); 14 Mar 2004 16:24:50 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 14 Mar 2004 16:24:50 -0000 Received: (qmail 96263 invoked by uid 1569); 14 Mar 2004 16:24:55 -0000 Date: 14 Mar 2004 16:24:55 -0000 Message-ID: <20040314162455.96262.qmail@minotaur.apache.org> From: nd@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/server core.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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 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 + container. PR 14726. [Andr� Malo] + *) htpasswd: use apr_temp_dir_get() and general cleanup [Guenter Knauf , 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;