httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject [Fwd: os-windows/1558: Alias to other drives gives error 404]
Date Sat, 27 Dec 1997 17:44:27 GMT
ben@hyperreal.org wrote:
> Synopsis: Alias to other drives gives error 404
> 
> State-Changed-From-To: feedback-analyzed
> State-Changed-By: ben
> State-Changed-When: Sat Dec 27 09:21:06 PST 1997
> State-Changed-Why:
> Actually, it doesn't work. Nor will "Alias /fred /" on a Unix
> box. This is because get_path_info() will strip a leading /
> if the path is simply "/" or "x:/". I'm working on a fix.

Arg! Fixing this ain't so easy. Firstly, get_path_info() is bugged, as
noted above. I stuck this in (at the beginning) in an attempt to fix it:

#ifdef WIN32
    /* I want to be able to assume that the path has the form x:/stuff,
but I'm not sure it
    is always true. Assert it. [Ben] */
    ap_assert(path[1] == ':');
#endif

    /* Advance over trailing slashes ... NOT part of filename */

    for (cp = end;
#ifdef WIN32
	 cp > path+3
#else
	 cp > path+1
#endif
	     && cp[-1] == '/'; --cp)
        continue;

Nasty, huh? So, question one is: can I make the assumption I'm making?

Anyway, this half works - it stops the leading / from being stripped.
But, weirdly, Win32 returns an error if you try to stat "d:/" (or
"d:\"). Huh? What gives? Anyone got any ideas?

Also, whilst debugging, I noticed that os_canonical_filename() doesn't
work correctly if handed "/". Just thought I'd mention it!

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 |Apache-SSL author
A.L. Digital Ltd,     |http://www.algroup.co.uk/Apache-SSL
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache

Mime
View raw message