httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: Win32: Why strlwr os_canonical_filename?
Date Fri, 02 Oct 1998 16:58:20 GMT
Marc Slemko wrote:
> 
> On Wed, 30 Sep 1998, Ken Parzygnat wrote:
> 
> > I have a question regarding the following code
> > segment from sub_canonical_filename:
> >
> > if (h == INVALID_HANDLE_VALUE) {
> >     ap_assert(strlen(szCanon) + strlen(szFilePart) + nSlashes < nCanon);
> >     for (n = 0; n < nSlashes; ++n) {
> >         strcat(szCanon, "/");
> >     }
> >     strcat(szCanon, szFilePart);
> >     return FALSE;
> > }
> > else {
> >     ap_assert(strlen(szCanon)+strlen(d.cFileName) < nCanon);
> >     strlwr(d.cFileName);
> >     strcat(szCanon, d.cFileName);
> >     return TRUE;
> > }
> >
> > Why is strlwr being called in the else leg?  Can we remove
> > this call?
> 
> Because we need some way to be able to try to compare filenames, for
> numerous purposes such as access control.
> 
> Because, due to the greatness of Win32, there are around 9543 different
> names for any file, and differing case is one of those ways, we have to
> lowercase things.
> 
> This should, however, only be done on the actual filename part, nothing
> else.  I seem to remember this being fixed three or four times.

It is only being done on the actual filename part.

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686| Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org/
and Technical Director|Email: ben@algroup.co.uk |
A.L. Digital Ltd,     |Apache-SSL author     http://www.apache-ssl.org/
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache/

WE'RE RECRUITING! http://www.aldigital.co.uk/

Mime
View raw message