httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <ako...@organic.com>
Subject Re: Win32 name canonicalisation
Date Mon, 11 Aug 1997 22:56:17 GMT
On Mon, 11 Aug 1997, Ben Laurie wrote:

> Alexei Kosut wrote:
> > Two concerns: First, FindFirstFile() expands out * and ?. Should we have
> > the function (how about os_canon_filename() as a name?) reject filenames
> > with those in it, or should we just let it expand them>
> 
> This makes it easy to trawl for hidden files, so perhaps we should do
> something about it. Can they be escaped?

Not to my knowledge. I tried a few obvious escape characters, but it
didn't seem to work.

[...]

> We can blame MS for the drive letters :-)

So you think if we called up Bill and complained, he'd change it? :)

> Seriously, you haven't got a full path without a drive letter, so I
> can't see that it is a problem.

I suppose.

> I don't see why we need to add REG_ICASE - we just state that canonical
> filenames are all lowercase. Hmmm ... but perhaps the PATH_INFO bit
> should not be lowercased.

It's slightly counter-intuitive for the canonical Apache filenames to be
of a different case than the Windows case. I can easily see (and it makes
sense) people creating a directory called "Foo" and putting <Directory
/Foo> in their config file. For <Directory>, we can call
os_canon_filename() on it, but for regex, we have to add a REG_ICASE.

Actually, considering this a bit... I'm not actually sure strlwr() is
neccessary. If we call os_canon_filename() (or whatever) on r->filename,
and we've called it on all the <Directory> and <Files> sections, and we
use REG_ICASE, then there shouldn't be any problems with different-case
matching, since they would both now conform to Windows' perferred case,
right? Unless someone changes the case of a directory's name between
when Apache was started and when a request comes in.

But at any rate, if we put os_canon_filename() after get_path_info(), as
I suggested, we wouldn'[t have to worry about PATH_INFO, since it would
already be set using the case from the URL.

-- Alexei Kosut <akosut@organic.com>


Mime
View raw message