httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <>
Subject RE: [patch] 1.3.15 ap_os_is_path_absolute
Date Thu, 02 Nov 2000 14:20:56 GMT
> From: Brian Havard []
> Sent: Thursday, November 02, 2000 3:58 AM
> [...] To produce a canonical file name you must
> map all possible ways of specifying a particular file to a single value.
> Considering that the CWD can change, the resulting value MUST be an
> absolute path, including the drive letter if on a platform 
> that uses them.

YES, but... we are entirely rewriting canonical names for Apache 2.0.
It is -too much- for 1.3 and the associated audit involved.

It's too computationally intensive unless we cache the elements that have
already been reformatted.  That's how canonical is prototyped for 2.0.
You will have relative or absolute apr_canon_file_t results, and merging
a relative into a fixed recanonicalizes those elements that are now
'grounded' in reality (e.g. right the case, etc).

> No, that's not how I'd rather do it, I'd prefer to find the 
> correct fix.  Why doesn't ap_os_is_path_absolute() look for 
> backslashes on Win32?

That was my proposed solution #1 - and I didn't veto, find 4 +1's to 
push over my own -1 [not vetoing] and I will commit exactly that.

It is one more place (on Win32) that I have elimiated -all-
ambiguity, to assure we don't have some module author or the
core server accepting cruft for file system paths.  The patch
did exactly what I expected, only too well, since module add-on
authors have ignored the caviats and warnings not to use 
backslashes, so this isn't even a user error.  

The problem: server tests absolute - then makes a full path
(seems reasonable.)  But an uncanonical name can't be tested
with 100% faith that it is absolute or not.

That's why 2.0 apr_canon_file_t will be testable for absolute,
proper relative and other conditions.  Get the full path or
elements back out, or get the true path (unwinding symlinks.)
It will all be in one place.  Abstract it out and noone will 
trip over other platforms shoelaces.  

This is too heavy a solution/overhaul for this late release
in the 1.3.x cycle.

IMHO, move the DosGetFullPath over to ap_make_full_path() in
an #ifdef OS2 escape, and everyone shares predictable results.
But I'm not wasting more keystrokes aruging this point, it's
your platform.

We _will_ bang out a single source for canonical under APR for 
both Win32 and OS2 (with a few #ifdef escapes for long names 
or whatnot), and a single theory for all platforms (even the
purish Un*x ones can have case insensitive, case preserving
mount points today.)  Look for that code this weekend, but 
please don't pull me out to reargue an issue I've spent over a 
full month auditing, debating, coding, and debugging.  It's a
more predictable by an order of magnitude today.  And that's
plenty for the 1.3.x family.

View raw message