Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Apr 2014 15:31:31 GMT
From:      Christian Neukirchen <chneukirchen@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   standards/188173: O_NOFOLLOW visibility not POSIX 2008 conforming
Message-ID:  <201404011531.s31FVVNR008903@cgiserv.freebsd.org>
Resent-Message-ID: <201404011540.s31Fe0rD022781@freefall.freebsd.org>

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

>Number:         188173
>Category:       standards
>Synopsis:       O_NOFOLLOW visibility not POSIX 2008 conforming
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-standards
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 01 15:40:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Christian Neukirchen
>Release:        10.0-RELEASE
>Organization:
>Environment:
FreeBSD mneme.vuxu.org 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
The macro O_NOFOLLOW is not defined when _XOPEN_SOURCE is set, but it should be defined with _XOPEN_SOURCE=700 since X/Open 7 incorporates POSIX 2008, which defines O_NOFOLLOW, cf. http://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html
>How-To-Repeat:
By default, O_NOFOLLOW is defined:

% cc -E - <<EOF | tail -1 
#include <fcntl.h>
O_NOFOLLOW
EOF
0x0100

But with correct _XOPEN_SOURCE, it is not:

% cc -D_XOPEN_SOURCE=700 -E - <<EOF | tail -1
#include <fcntl.h>
O_NOFOLLOW
EOF
O_NOFOLLOW

>Fix:
Adjust the condition in /usr/include/sys/fcntl.h to use _POSIX_C_SOURCE >= 200809

#if __BSD_VISIBLE
#define O_NOFOLLOW      0x0100          /* don't follow symlinks */
#endif


>Release-Note:
>Audit-Trail:
>Unformatted:



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