From: <[EMAIL PROTECTED]>
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 "".

Reply via email to