Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 6198 invoked by uid 6000); 15 Dec 1998 16:41:57 -0000 Received: (qmail 6190 invoked from network); 15 Dec 1998 16:41:54 -0000 Received: from slarti.muc.de (193.174.4.10) by taz.hyperreal.org with SMTP; 15 Dec 1998 16:41:54 -0000 Received: (qmail 20285 invoked by uid 66); 15 Dec 1998 16:38:31 -0000 Received: from en by slarti with UUCP; 15 Dec 1998 16:38:31 -0000 (GMT) Received: by en1.engelschall.com (Sendmail 8.9.1) for new-httpd@apache.org id RAA24342; Tue, 15 Dec 1998 17:41:54 +0100 (CET) Date: Tue, 15 Dec 1998 17:41:54 +0100 From: "Ralf S. Engelschall" To: Apache Group Developer ML Subject: [PATCH] Fix a few minor inconsistencies related to directive scoping Message-ID: <19981215174154.A24334@engelschall.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95i Organization: Engelschall, Germany. X-Web-Homepage: http://www.engelschall.com/ X-PGP-Public-Key: https://www.engelschall.com/ho/rse/pgprse.asc X-PGP-Fingerprint: 00 C9 21 8E D1 AB 70 37 DD 67 A2 3A 0A 6F 8D A5 Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org Fix a few minor inconsistencies related to directive scoping ============================================================ 1. httpd -h Under "httpd -h" one gets a nice English description in which scope a directive can occur. But we talk here only about and , although is treated the same (also with `cmd->override == ACCESS_CONF|OR_ALL'). So I think it's correct to also list , too. 2. Used scope variants Currently we have 203 directives and they use the following scopes (the numbers in parenthesis gives the number of directives using a particular scope): RSRC_CONF (106) RSRC_CONF|ACCESS_CONF (5) RSRC_CONF|ACCESS_CONF|OR_ALL (1) <-- RSRC_CONF|ACCESS_CONF|OR_AUTHCFG (2) <-- ACCESS_CONF (5) OR_AUTHCFG (20) OR_LIMIT (3) OR_OPTIONS (4) OR_FILEINFO (21) OR_INDEXES (23) OR_ALL (13) This is well spreaded and sounds reasonable. Except for the two classes: RSRC_CONF|ACCESS_CONF|OR_ALL (1) RSRC_CONF|ACCESS_CONF|OR_AUTHCFG (2) The first one is just a syntax overkill. It means only OR_ALL, because OR_ALL includes (implicitly) already RSRC_CONF and ACCESS_CONF. So, when we fix this to OR_ALL we get: RSRC_CONF (106) RSRC_CONF|ACCESS_CONF (5) RSRC_CONF|ACCESS_CONF|OR_AUTHCFG (2) <-- ACCESS_CONF (5) OR_AUTHCFG (20) OR_LIMIT (3) OR_OPTIONS (4) OR_FILEINFO (21) OR_INDEXES (23) OR_ALL (14) The remaining RSRC_CONF|ACCESS_CONF|OR_AUTHCFG is used by two directives: UseCanonicalName and ContentDigest. Two not too old directives which were added mostly at the same time. They're are implemented the same way. But the scope looks incorrect. Why? First, it's again syntax overkill, ok. We can reduce it to RSRC_CONF|OR_AUTHCFG. But when we compare it to all other used scopes, it looks very inconsistent. No other of the 203 directives want to be applicable in such a non-orthoginal scope: on the first hand inside the AuthConfig scope (which means .htaccess under "AllowOverride AuthConfig" plus _INSIDE_ of // sections in httpd.conf only) and on the other hand also in RSRC_CONF (which means _OUTSIDE_ of // sections in httpd.conf only). Sure, finally it's everywhere in httpd.conf plus .htaccess under AuthConfig scope. But it's not intuitive: Directives which want to be applicable in such a total scope use OR_OPTIONS, OR_FILEINFO or OR_INDEXES. And when we think about UseCanonicalName and ContentDigest we find out that they belongs more to Options, XBitHack and CheckSpelling than to any AuthXXXX directives. So, I propose to change the scope of those two directives to OR_OPTIONS. It makes no big difference, of course. It still is useable everwhere inside httpd.conf, but inside .htaccess now under Options instead of AuthConfig. And it both belongs to the more correct group of directives and makes our list of used scopes more consistent. With the above patch be get this consistent scope-list: RSRC_CONF (106) RSRC_CONF|ACCESS_CONF (5) ACCESS_CONF (5) OR_AUTHCFG (20) OR_LIMIT (3) OR_OPTIONS (6) OR_FILEINFO (21) OR_INDEXES (23) OR_ALL (14) When we take into account that _theoretically_ there are a lot more variants of these or'ed values are possible, this list is _VERY_ clean. Actually it's the most clean variant I can think of (except for the fact that the whole mechanism is a horrible mess ;-)... Ralf S. Engelschall rse@engelschall.com www.engelschall.com Index: src/CHANGES =================================================================== RCS file: /e/apache/REPOS/apache-1.3/src/CHANGES,v retrieving revision 1.1170 diff -u -r1.1170 CHANGES --- src/CHANGES 1998/12/12 05:26:00 1.1170 +++ src/CHANGES 1998/12/15 16:37:04 @@ -1,5 +1,10 @@ Changes with Apache 1.3.4 + *) Fix some inconsistencies related to the scopes of directives. The only + user visible change is that the directives `UseCanonicalName' and + `ContentDigest' now use the (more correct) `Options' scope instead of + (less correct) `AuthConfig' scope. [Ralf S. Engelschall] + *) Added two new core API functions, ap_single_module_configure() and ap_single_module_init(), which are now used by mod_so to correctly initialize a module after loading. This fixes a problem with unusable Index: src/main/http_config.c =================================================================== RCS file: /e/apache/REPOS/apache-1.3/src/main/http_config.c,v retrieving revision 1.137 diff -u -r1.137 http_config.c --- src/main/http_config.c 1998/12/12 05:26:03 1.137 +++ src/main/http_config.c 1998/12/15 16:11:44 @@ -1557,9 +1557,9 @@ ((pc->req_override & (ACCESS_CONF | OR_AUTHCFG | OR_LIMIT))))) printf("anywhere"); else if (pc->req_override & RSRC_CONF) - printf("only outside or "); + printf("only outside , or "); else - printf("only inside or "); + printf("only inside , or "); /* Warn if the directive is allowed inside or .htaccess * but module doesn't support per-dir configuration */ Index: src/main/http_core.c =================================================================== RCS file: /e/apache/REPOS/apache-1.3/src/main/http_core.c,v retrieving revision 1.241 diff -u -r1.241 http_core.c --- src/main/http_core.c 1998/11/20 21:17:28 1.241 +++ src/main/http_core.c 1998/12/15 16:11:49 @@ -2584,10 +2584,10 @@ "Whether persistent connections should be On or Off" }, { "IdentityCheck", set_idcheck, NULL, RSRC_CONF|ACCESS_CONF, FLAG, "Enable identd (RFC 1413) user lookups - SLOW" }, -{ "ContentDigest", set_content_md5, NULL, RSRC_CONF|ACCESS_CONF|OR_AUTHCFG, +{ "ContentDigest", set_content_md5, NULL, OR_OPTIONS, FLAG, "whether or not to send a Content-MD5 header with each request" }, { "UseCanonicalName", set_use_canonical_name, NULL, - RSRC_CONF|ACCESS_CONF|OR_AUTHCFG, FLAG, + OR_OPTIONS, FLAG, "Whether or not to always use the canonical ServerName : Port when " "constructing URLs" }, { "StartServers", set_daemons_to_start, NULL, RSRC_CONF, TAKE1, @@ -2664,7 +2664,7 @@ "Limit (0 = unlimited) on max number of header fields in a request message"}, { "LimitRequestBody", set_limit_req_body, (void*)XtOffsetOf(core_dir_config, limit_req_body), - RSRC_CONF|ACCESS_CONF|OR_ALL, TAKE1, + OR_ALL, TAKE1, "Limit (in bytes) on maximum size of request message body" }, { NULL }, }; Index: htdocs/manual/mod/core.html =================================================================== RCS file: /e/apache/REPOS/apache-1.3/htdocs/manual/mod/core.html,v retrieving revision 1.141 diff -u -r1.141 core.html --- htdocs/manual/mod/core.html 1998/11/23 15:21:18 1.141 +++ htdocs/manual/mod/core.html 1998/12/15 16:27:11 @@ -445,7 +445,7 @@ Override: AuthConfig
+>Override: Options
Context: server config, virtual host, directory, .htaccess
-Override: AuthConfig
+Override: Options
Compatibility: UseCanonicalName is only available in Apache 1.3 and later