>Number:         5353
>Category:       general
>Synopsis:       PATH_INFO is set incorrectly when <Location>s are used.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Tue Nov 23 07:10:01 PST 1999
>Last-Modified:
>Originator:     [EMAIL PROTECTED]
>Organization:
apache
>Release:        Apache/1.3.9 (Unix)
>Environment:
SunOS 5.6 Generic_105181-15 sun4u sparc SUNW,Ultra-250
>Description:
If I create a location using

<Location /path/more/>
...
  AddHandler handler .ext
</Location>

and then access http://server/path/more/file.ext (thus invoking the handler 
for .ext files in the location), PATH_INFO will contain /more/file.ext, and
not /path/more/file.ext. Apache always removes the first element from the 
virual path, i.e. a <Location /path/> would result in /file.ext being sent in
as PATH_INFO, with the preceding path missing.

>How-To-Repeat:
No URL avail.
>Fix:
The problem seems to be in http_request.c. The function get_path_info()
will not work correctly if all it finds are directories, but no files.
My line 259 says:

if (S_ISDIR(r->finfo.st_mode) && last_cp) {
     r->finfo.st_mode = 0;   /* No such file... */
     cp = last_cp;
}

find_path_info() walks backward through the requested path, after it has been 
mapped
to the DocumentRoot (i.e. /opt/docroot/path/more/file.exe in above example),
and looks for non-virtual components. It finds /opt/docroot/, and so it sets 
PATH_INFO (cp in this case) to the last path it examined (minus
the document root) which was "/more/file.exe". 

Removing the line "cp = last_cp" solves the problem in this case, but I'm sure
it was there for a good reason!
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <[EMAIL PROTECTED]> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or      ]
["Re: general/1098:").  If the subject doesn't match this       ]
[pattern, your message will be misfiled and ignored.  The       ]
["apbugs" address is not added to the Cc line of messages from  ]
[the database automatically because of the potential for mail   ]
[loops.  If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request from a  ]
[developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]



Reply via email to