delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/09/22/07:37:35

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL
X-Spam-Check-By: sourceware.org
Message-ID: <4AB8B6E9.2060806@byu.net>
Date: Tue, 22 Sep 2009 05:37:13 -0600
From: Eric Blake <ebb9 AT byu DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: [1.7] symlink regression
References: <loom DOT 20090921T170236-884 AT post DOT gmane DOT org> <20090922092701 DOT GQ20981 AT calimero DOT vinschen DOT de>
In-Reply-To: <20090922092701.GQ20981@calimero.vinschen.de>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Corinna Vinschen on 9/22/2009 3:27 AM:
> I reworked symlink's error handling so that in my testing I now get
> the exact same error messages as on Linux:
> 
>   $ rm wqwqwq
>   $ ln -sT nowhere wqwqwq/
>   ln: creating symbolic link `wqwqwq/': No such file or directory

One oddity left:

$ touch a
$ ln -sT nowhere a/ => EEXIST
$ ln -sT nowhere a// => ENOTDIR

On Linux, both fail with EEXIST (but this violates POSIX, since a/ does
not exist).  On Solaris, both fail with ENOTDIR (which makes more sense).

The reason that cygwin is inconsistent is that you created newpath but
only truncated the final /, rather than checking for multiple /.  Here's
once case where I think it might be smarter to match Solaris and fail with
ENOTDIR regardless of how many trailing slashes, rather than matching
Linux and failing with EEXIST, particularly since it is faster (we don't
have to even bother with creating newpath); but if we want to match Linux,
then we have to handle all trailing when creating newpath.

But at least the testsuite where I originally found the issue now passes
(since it accepts either EEXIST or ENOTDIR).  So I could also live with
inaction, making no further changes to your patch.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkq4tukACgkQ84KuGfSFAYC6EQCfVw0pmvmTPiVDHvqer00mP6Me
7vgAn3yFprWCkfvelPJtYLL+FIO8+RUt
=qOce
-----END PGP SIGNATURE-----

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019