apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Branko ─îibej <br...@xbc.nu>
Subject Re: cvs commit: apr/include apr_errno.h
Date Tue, 16 Apr 2002 22:16:22 GMT
William A. Rowe, Jr. wrote:

> At 09:32 AM 4/16/2002, you wrote:
>
>> brane       02/04/16 07:32:03
>>
>>   Modified:    include  apr_errno.h
>>   Log:
>>   On Windows, ERROR_PATH_NOT_FOUND is an ENOENT, not an ENOTDIR -- 
>> same as OS/2.
>
>
> I'm somewhat dubious of this change.  Can you please point to the use 
> case
> (a specific scenario) that this existing define misbehaved?  The 
> greatest risk is
> that Apache -needs- to see ENOTDIR in the right times to avoid a ton 
> of extra
> effort, but most importantly, to make the right security decisions on 
> errors.

It's a question of correct semantics. ENOTDIR means "This is not a 
directory", and it's what you expect if, e.g., you try to rmdir a file. 
ENOENT means "This bit doesn't exist".

Here's an example of what happened before this change; supposing that 
"foo" does not exist:

                    |  Unix  | Windows
--------------------+--------+---------
apr_stat("foo")     | ENOENT | ENOENT
apr_stat("foo/bar") | ENOENT | ENOTDIR


The APR_ENOTDIR result on Windows is semantically wrong.

In fact, it may be that the other codes in the Windows 
APR_STATUS_IS_ENOTDIR should really be in ENOENT, too.


-- 
Brane ─îibej   <brane@xbc.nu>   http://www.xbc.nu/brane/




Mime
View raw message