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>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] 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: > > > http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00080.html > > > > http://git.savannah.gnu.org/cgit/tar.git/commit/?id=1584b72ff271e7f826dd64d7a1c7cd2f66504acb > > http://git.savannah.gnu.org/cgit/tar.git/commit/?id=649b747913d2b289e904b5f1d222af886acd209c > > > 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. > > > 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. > > 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. -- Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk19G/IACgkQForvXbEpPzStAACgtodD99wJDrlF1HMRGnKG5QF1 T5oAn3pkoXgktTYsek/JXbrd1ne5L65/ =Nkcw -----END PGP SIGNATURE-----help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110313193320.GC40734>
