Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 60618 invoked by uid 500); 26 Sep 2001 14:41:50 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 60607 invoked by uid 500); 26 Sep 2001 14:41:50 -0000 Delivered-To: apmail-apache-1.3-cvs@apache.org Date: 26 Sep 2001 14:41:11 -0000 Message-ID: <20010926144111.35336.qmail@icarus.apache.org> From: stoddard@apache.org To: apache-1.3-cvs@apache.org Subject: cvs commit: apache-1.3/src/os/win32 os.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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 #include #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++ = '\\';