httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ken Parzygnat" <kp...@raleigh.ibm.com>
Subject RE: [PATCH] Win32 device files
Date Sat, 05 Dec 1998 16:30:57 GMT
[...]
> > 
> > #ifdef WIN32
> >     /* If the path is x:/, then convert it to x:/., coz that's what stat
> >      * needs to work properly
> >      */
> 
> Umm, who knows? I've just tried it on NT 4 SP4 and stat works with or
> without a trailing . (or in fact, any number of trailing dots). (Small
> test program available on request, if anyone else wants to try on
> different systems).
> 
> Part of the problem with supporting Windows is that there are lots of
> incompatibilities between different versions (95/NT), releases, service
> pack updates, MSIE versions, and all the other little packages and
> products which "upgrade" your "system" libraries (if Windows has such as
> concept). So this was probably true on some configuration somewhere, and
> it would be nice to find a list of all the differences between different
> versions of the standard DLL's somewhere (say on MS's site!) but I don't
> think there is one. 
> 

I've solved one part of the problem.  The adding of the '.' to names
like x:/ appears to have been necessary because of the code that 
follows.  It attempts to remove the trailing '/' from the name.  This is
usually OK, except when you have x:/ because x: is not a valid directory.
I wrote some code to fix this for UNC names, because you have the 
same problem with //machine/share and //machine/share/  
I was able to make the same adjustment for x:/
I've placed the patch below.

The second problem I'd found may be a little more sticky.  The 
problem was when I specify a UNC alias
Alias /shareme/ //machine/share/

This breaks with ap_os_is_filename_valid because it is getting
passed the name "//.htaccess".  I traced it back to the 
directory_walk routine.  We're not handling UNC names there
correctly.  The name //machine/share/ is seen as 4 directories.
So we first look for /.htaccess, then //.htaccess
Seems to me that we need to initally jump past the machine
and share name before we start doing the walking.

Maybe someone who is more intimate with
directory_walk could spot an easy fix.


--- http_request.c.first	Sat Dec 05 13:59:24 1998
+++ http_request.c	Sat Dec 05 14:32:36 1998
@@ -179,7 +179,6 @@
     char *last_cp = NULL;
     int rv;
 #ifdef WIN32
-    char buf[5];
     BOOL bStripSlash=TRUE;
 #endif

@@ -189,16 +188,12 @@
     }

 #ifdef WIN32
-    /* If the path is x:/, then convert it to x:/., coz that's what stat
-     * needs to work properly
+    /* If the directory is x:\, then we don't want to strip
+     * the trailing slash since x: is not a valid directory.
      */
-    if (strlen(path) == 3 && path[1] == ':') {
-	strcpy(buf,path);
-	buf[3]='.';
-	buf[4]='\0';
-	path=buf;
-	end=buf+4;
-    }
+    if (strlen(path) == 3 && path[1] == ':' && path[2] == '/')
+        bStripSlash = FALSE;
+

     /* If UNC name == //machine/share/, do not
      * advance over the trailing slash.  Any other



- - - - - - - - - - - - - - - - - -
Ken Parzygnat
email: kparz@raleigh.ibm.com 











--------------------------------------------------------------------------------
Users of the Apache webserver are hereby granted a non-exclusive, irrevocable,
world-wide, royalty-free, non-transferable license to use, execute, prepare
derivative works of, and distribute (internally and externally, and including
derivative works) the code accompanying this license as part of, and
integrated into the Apache webserver.  This code is provided "AS IS" WITHOUT
WARRANTY OF ANY KIND EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTY OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
AND ANY WARRANTY OF NON-INFRINGEMENT.  THE ENTIRE RISK ARISING OUT OF THE USE
OR PERFORMANCE OF THIS CODE REMAINS WITH USERS OF THE APACHE WEBSERVER.  The
owner of this code represents and warrants that it is legally entitled to
grant the above license.

Mime
View raw message