httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <>
Subject Re: cool core dir config bug
Date Sun, 16 Dec 2001 19:33:53 GMT
The problem appears to be in ap_directory_walk():

        do {
            int res;
            char *seg_name;
            char *delim;
            int temp_slash=0;
            /* We have no trailing slash, but we sure would appreciate 
            if (sec_idx && r->filename[filename_len-1] != '/') {
                r->filename[filename_len++] = '/';
                r->filename[filename_len] = 0;

            /* Begin *this* level by looking for matching <Directory> 
             * from the server config.
            for (; sec_idx < num_sec; ++sec_idx) {

                ap_conf_vector_t *entry_config = sec_ent[sec_idx];
                core_dir_config *entry_core;
                entry_core = ap_get_module_config(entry_config, 

                /* No more possible matches for this many segments?
                 * We are done when we find relative/regex/longer 
                if (entry_core->r || entry_core->d_components > seg) {

We end up breaking out of the for loop in that last conditional
above, and sec_idx never gets incremented.  Because sec_idx is
still zero, the trailing slash doesn't get appended on the next
loop iteration.  When we finally get to the directory config
for /manual, the paths don't match because r->filename lacks
a trailing slash.

I think we need different logic for deciding when to add the
trailing slash.


Jeff Trawick wrote:

>Run this config as-is and DEFLATE is never added.  Uncomment the empty
>"Directory /" container and it works.  Something is hosed in dir
>config merge or something like that.
>--------cut here---------
>TypesConfig conf/mime.types
>ServerRoot "/home/trawick/apacheinst"
>Timeout 300
>Listen 8080
>DocumentRoot "/home/trawick/apacheinst/htdocs"
>Alias /manual "/home/trawick/apacheinst/manual"
>#<Directory />
><Directory "/home/trawick/apacheinst/manual/">
>SetOutputFilter DEFLATE
>ErrorLog logs/error_log
>LogLevel debug
>LogFormat "%h %l %u %t \"%r\" %>s %b" common
>CustomLog logs/access_log common
>---------cut here---------

View raw message