httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 20168] New: - request dir not available to scripts processing DirectoryIndex with absolute paths
Date Thu, 22 May 2003 20:35:20 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20168>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20168

request dir not available to scripts processing DirectoryIndex with absolute paths

           Summary: request dir not available to scripts processing
                    DirectoryIndex with absolute paths
           Product: Apache httpd-2.0
           Version: 2.0.45
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: mod_dir
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: jaboydjr@netwalk.com
                CC: jaboydjr@netwalk.com


The Apache2 docs suggest that a script with an absolute pathname can be used by
DirectoryIndex to provide indexing for a requested directory, e.g.

 	DirectoryIndex index.html /cgi-bin/index.cgi

is the example given.  The problem is that the request url and all other
information available to such a script identifies the script, not the
requested directory.  Especially if directories are aliased, it may be
impossible to locate the requested directory in order to process it.

I am attaching my workaround for this problem, and would stress that I only
consider it a workaround.  This workaround adds REQUEST_DIR to the
environment passed to a script to which mod_dir passes a request, so that
the script can easily determine what directory is to be indexed.
This is a minimally disruptive patch, with the problem that REQUEST_DIR is
not a standard CGI variable.

=============================================================================
--- httpd-2.0.45/modules/mappers/mod_dir.c.orig	2003-02-03 12:31:43.000000000 -0500
+++ httpd-2.0.45/modules/mappers/mod_dir.c	2003-04-18 18:44:56.000000000 -0400
@@ -183,6 +183,8 @@
         num_names = 1;
     }
 
+    apr_table_setn(r->subprocess_env, "REQUEST_DIR", r->filename);
+
     for (; num_names; ++names_ptr, --num_names) {
         /* XXX: Is this name_ptr considered escaped yet, or not??? */
         char *name_ptr = *names_ptr;

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message