httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@apache.org
Subject cvs commit: apache-1.3/src/os/win32 os.c
Date Wed, 26 Sep 2001 14:41:11 GMT
stoddard    01/09/26 07:41:11

  Modified:    src/os/win32 os.c
  Log:
  Win32: Set errno to ENAMETOOLONG when os_stat() returns -1.
  
  This will fix problem where Apache on Windows can return a directory index when
  it should return a negotiated file.  read_types_multi() iterates over
  the entries in a directory to build a candidate list of
  files to negotiate.  ap_sub_req_lookup_file() is called for each file
  which in turn calls stat() (os_stat() on Windows) to verify the file exists.
  mod_negotiation will decline the request (rather than failing the
  request as it should) if os_stat() fails and errno is not set.
  
  Revision  Changes    Path
  1.7       +3 -0      apache-1.3/src/os/win32/os.c
  
  Index: os.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/os/win32/os.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- os.c	2001/09/11 03:03:44	1.6
  +++ os.c	2001/09/26 14:41:11	1.7
  @@ -65,6 +65,7 @@
   #include <stdio.h>
   #include <time.h>
   #include "os.h"
  +#include "errno.h"
   
   /* Win95 doesn't like trailing /s. NT and Unix don't mind. This works 
    * around the problem.
  @@ -81,6 +82,7 @@
       int len = strlen(szPath);
       
       if ((len == 0) || (len >= MAX_PATH)) {
  +        errno = ENAMETOOLONG;
           return -1;
       }
   
  @@ -99,6 +101,7 @@
   	/* then we need to add one more to get \\machine\share\ */
   	if (nSlashes == 3) {
               if (++len >= MAX_PATH) {
  +                errno = ENAMETOOLONG;
                   return -1;
               }
   	    *s++ = '\\';
  
  
  

Mime
View raw message