Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Mar 2011 20:33:20 +0100
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Jilles Tjoelker <jilles@stack.nl>
Cc:        freebsd-fs@freebsd.org, freebsd-standards@freebsd.org
Subject:   Re: open(O_NOFOLLOW) error when encountered symlink
Message-ID:  <20110313193320.GC40734@garage.freebsd.pl>
In-Reply-To: <20110312193131.GA97300@stack.nl>
References:  <20110312170123.GT78089@deviant.kiev.zoral.com.ua> <20110312193131.GA97300@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help

--ncSAzJYg3Aa9+CRW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Mar 12, 2011 at 08:31:32PM +0100, Jilles Tjoelker wrote:
> On Sat, Mar 12, 2011 at 07:01:23PM +0200, Kostik Belousov wrote:
> > Hello,
> > I noted the following discussion and commits in the gnu tar repository:
>=20
> > http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00080.html
> >=20
> > http://git.savannah.gnu.org/cgit/tar.git/commit/?id=3D1584b72ff271e7f82=
6dd64d7a1c7cd2f66504acb
> > http://git.savannah.gnu.org/cgit/tar.git/commit/?id=3D649b747913d2b289e=
904b5f1d222af886acd209c
>=20
> > The issue is that in case of open(path, O_NOFOLLOW), when path is naming
> > a symlink, FreeBSD returns EMLINK error. On the other hand, the POSIX
> > requirement is absolutely clear that it shall be ELOOP.
>=20
> > I found FreeBSD commit r35088 that specifically changed the error code
> > from the required ELOOP to EMLINK. I doubt that somebody can remember
> > a reason for the change done more then 12 years ago.
>=20
> In fact that change was done hours after the new ELOOP error.

I don't think that POSIX knew about O_NOFOLLOW at that time, so peter@
properly predicted ELOOP, but some evil creature convinced him to change
it to EMLINK.

This is from 2004:

	http://pubs.opengroup.org/onlinepubs/009695399/functions/open.html

and not a word about O_NOFOLLOW.

PS. I'm voting with both hands to change it to ELOOP.

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://yomoli.com

--ncSAzJYg3Aa9+CRW
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAk19G/IACgkQForvXbEpPzStAACgtodD99wJDrlF1HMRGnKG5QF1
T5oAn3pkoXgktTYsek/JXbrd1ne5L65/
=Nkcw
-----END PGP SIGNATURE-----

--ncSAzJYg3Aa9+CRW--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110313193320.GC40734>