Hi,
I have just stumbled across this function in Apache2::RequestUtil. The
"# if 0" is mine.
Does anybody recall WHY the lines between "# if 0" and "# endif" were put in
in the first place?
I have checked the SVN. They were already present in the very first version of
the file.
static MP_INLINE
int mpxs_Apache2__RequestRec_location_merge(request_rec *r,
char *location)
{
apr_pool_t *p = r->pool;
server_rec *s = r->server;
core_server_config *sconf = ap_get_module_config(s->module_config,
&core_module);
ap_conf_vector_t **sec = (ap_conf_vector_t **)sconf->sec_url->elts;
int num_sec = sconf->sec_url->nelts;
int i;
for (i=0; i<num_sec; i++) {
core_dir_config *entry =
(core_dir_config *)ap_get_module_config(sec[i],
&core_module);
if (strEQ(entry->d, location)) {
# if 0
if (!entry->ap_auth_type) {
entry->ap_auth_type = "Basic";
}
if (!entry->ap_auth_name) {
entry->ap_auth_name = apr_pstrdup(p, location);
}
# endif
r->per_dir_config =
ap_merge_per_dir_configs(p, s->lookup_defaults, sec[i]);
return 1;
}
}
return 0;
}
The relevant test is t/protocol/pseudo_http.t and it's module
t/protocol/TestProtocol/pseudo_http.pm. The module contains the following
config:
<VirtualHost TestProtocol::pseudo_http>
PerlProcessConnectionHandler TestProtocol::pseudo_http
<Location TestProtocol::pseudo_http>
<IfModule @ACCESS_MODULE@>
Order Deny,Allow
Allow from @servername@
</IfModule>
<IfModule @AUTH_MODULE@>
# htpasswd -mbc basic-auth stas foobar
# using md5 password so it'll work on win32 too
AuthUserFile @ServerRoot@/htdocs/protocols/basic-auth
</IfModule>
# AuthName TestProtocol::pseudo_http
# AuthType Basic
Require user stas
Satisfy any
</Location>
</VirtualHost>
Again, the commented out lines (AuthName, AuthType) are mine.
When both sets of lines are inactive the test fails. But I strongly believe
that AuthName and AuthType if they are needed here should be configured in the
Location container and not be hardcoded, even as default values.
I'll remove the lines:
if (!entry->ap_auth_type) {
entry->ap_auth_type = "Basic";
}
if (!entry->ap_auth_name) {
entry->ap_auth_name = apr_pstrdup(p, location);
}
if nobody vetoes.
Torsten Förtsch
--
Need professional modperl support? Hire me! (http://foertsch.name)
Like fantasy? http://kabatinte.net
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]