open(O_NOFOLLOW) error when encountered symlink

Pawel Jakub Dawidek pjd at FreeBSD.org
Sun Mar 13 19:54:54 UTC 2011


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-standards/attachments/20110313/3035236f/attachment.pgp


More information about the freebsd-standards mailing list