httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <>
Subject Re: localization of content/apache server
Date Wed, 06 Aug 1997 19:28:41 GMT
On Wed, 6 Aug 1997, Ben Laurie wrote:

> > If this is a sound plan, I'll work up a patch.
> Sounds good to me. No doubt we've missed something, though ;-)

Yep. It turns out that GetFullPathName() didn't do everything I
thought. Although the API docs are a bit vauge, it doesn't expand 8.3
aliases to full names. So we can't do that that way.

We could use GetShortPathName() to translate all filenames to 8.3
aliases, but that would require that all the configuration and such be in
the short names, which is a horrid idea. Also, it wouldn't work correctly
on file systems that don't support 8.3 aliases.

The FindFirstFile() function can be used to translate 8.3 aliases to full
names (it does other things too, so we'd have to be careful), but it only
works on files that really exist, whereas Apache likes to work with files
that don't neccessarily exist. So we can't easily use
FindFirstFile(). What we want is a function that translates 8.3 aliases
in the pathname to full names for the part of the filename that exists,
and then ignores that part that doesn't.

However, this function doesn't seem to exist in Win32. We could write it
ourselves: Call FindFirstFile() on the filename, chopping off a path
segment each time it fails, until you get a fullname, then you tack the
part you chopped off back on. A bit ugly, but I think it'd be valid. The
only problem with using FindFirstFile() is that it also expands * and ?,
so we'd probably want to look for those and maybe return a forbidden if
they're there.

We could put this into directory_walk(), where it divides the filename
into path segments already, but I'd perfer to modify r->filename
directly first, so that it's correctly prepared for file_walk, regexes,
and any module that does security checks based on filename.

-- Alexei Kosut <>

View raw message