This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mkdir(2) bug [Was: please test: coreutils-5.90-2]


On Oct 12 06:58, Eric Blake wrote:
> I see the following bugs:
> 
> $ ./foo //   # should fail with EEXIST, not EROFS; no Windows call made
> //: 30 Read-only file system
> $ strace ./foo // | grep -B3 mkdir
>    65   18986 [main] foo 3788 build_fh_pc: fh 0x6115AE1C
>    34   19020 [main] foo 3788 path_conv::check: \\ is on a read-only
> filesystem
>    29   19049 [main] foo 3788 __set_errno: fhandler_base*
> build_fh_name(const char*, void*, unsigned int, suffix_info*):347 val 30
>    29   19078 [main] foo 3788 mkdir: got 30 error from build_fh_name
>    27   19105 [main] foo 3788 __set_errno: int mkdir(const char*,
> mode_t):274 val 30
>    64   19169 [main] foo 3788 mkdir: -1 = mkdir (//, 511)

We had this already.  There's no such thing as a "correct" order of error
messages.  EROFS is as correct as EEXIST.  If coreutils don't allow
different correct error messages to be returned, than coreutils is just
not foolproof enough.  If this isn't a problem with coreutils, than the
better.

> $ ./foo c:   # should fail with EEXIST, not EACCES
> c:: 13 Permission denied
> $ strace ./foo c: | grep -B3 mkdir
>    69  141826 [main] foo 1368 seterrno_from_win_error:
> /netrel/src/cygwin-snapshot-20051003-1/winsup/cygwin/fhandler_disk_file.cc:1225
> windows error 5
>    43  141869 [main] foo 1368 geterrno_from_win_error: windows error 5 ==
> errno 13
>    28  141897 [main] foo 1368 __set_errno: void
> seterrno_from_win_error(const char*, int, DWORD):310 val 13
>    54  141951 [main] foo 1368 mkdir: -1 = mkdir (c:, 511)

See my previous mail on this subject.

> $ ./foo /proc    # should fail with EEXIST, not EROFS
> /proc: 30 Read-only file system

See above.

> $ ./foo a/.   # should fail with EEXIST, not ENOENT
> a/.: 2 No such file or directory

I get ENOENT on Linux.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]