httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <b...@wstoddard.com>
Subject Re: cvs commit: apache-1.3/src/os/win32 os.c
Date Wed, 26 Sep 2001 20:55:04 GMT
Yep, you are right.  My head is a bit fuzzy recovering from some flu like bug.

Bill

----- Original Message ----- 
From: "William A. Rowe, Jr." <wrowe@covalent.net>
To: <dev@httpd.apache.org>; <apache-1.3-cvs@apache.org>
Sent: Wednesday, September 26, 2001 10:52 AM
Subject: Re: cvs commit: apache-1.3/src/os/win32 os.c


> From: <stoddard@apache.org>
> Sent: Wednesday, September 26, 2001 9:41 AM
> 
> 
> > 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.
> >   
> >        if ((len == 0) || (len >= MAX_PATH)) {
> >   +        errno = ENAMETOOLONG;
> >            return -1;
> >        }
> 
> This is wrong (above).  
> 
> Don't you mean...
> 
>     if (len == 0) {
>         errno = Esomecode;
>         return -1;
>     }
> 
>     if (len >= MAX_PATH) {
>         errno = ENAMETOOLONG;
>         return -1;
>     }
> 
> You can always ask Unix what error it likes for stat "".
> 


Mime
View raw message