This is the mail archive of the
mailing list for the Cygwin project.
bug in .. handling
- From: Eric Blake <ebb9 at byu dot net>
- To: cygwin at cygwin dot com
- Date: Sat, 09 Apr 2005 15:34:21 -0600
- Subject: bug in .. handling
Cygwin is taking too much liberty when resolving paths with .. in them.
I've tested this with both 1.5.14 and the 20050408 snapshot. POSIX requires
that the pathname before the .. exist, and if it is a symlink, that it is
resolved, before going to the parent directory. For example:
$ cd /tmp/example
$ mkdir -p a/b
$ ln -s a/b b
$ touch a/c a/b/d
$ ls b
$ ls b/.. # bug - should list contents of a, not .
$ ls a
$ ls none/.. # bug - should fail with ENOENT
$ ln -s e e
$ readlink -v e/none
readlink: e/foo: Too many levels of symbolic links
$ ls e/.. # bug - should fail with ELOOP
a b e
Basically, cygwin is blindly collapsing dir/.. into nothing, without first
verifying dir, in violation of POSIX.
Someday, I might put a cute statement here.
Eric Blake email@example.com
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html