Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Apr 2014 02:08:11 +0400
From:      Sergey Kandaurov <pluknet@gmail.com>
To:        Jilles Tjoelker <jilles@stack.nl>
Cc:        standards@freebsd.org, freebsd-gnats-submit@freebsd.org, Christian Neukirchen <chneukirchen@gmail.com>
Subject:   Re: standards/188173: O_NOFOLLOW visibility not POSIX 2008 conforming
Message-ID:  <CAE-mSOJKycH%2BbzoJroRn3zacxVuhkc6n8CCYpJBL9OonQYuwng@mail.gmail.com>
In-Reply-To: <20140405204748.GA20798@stack.nl>
References:  <201404011531.s31FVVNR008903@cgiserv.freebsd.org> <20140405201607.GL21331@kib.kiev.ua> <20140405204748.GA20798@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On 6 April 2014 00:47, Jilles Tjoelker <jilles@stack.nl> wrote:
> On Sat, Apr 05, 2014 at 11:16:07PM +0300, Konstantin Belousov wrote:
>> On Tue, Apr 01, 2014 at 03:31:31PM +0000, Christian Neukirchen wrote:
>> > >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
>> >
>
>> Thank you for noting this. Still, I want to formally request your
>> confirmation that the following patch works for you. I only have 1003.1,
>> 2013 access right now.
>
>> diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h
>> index 3461f8b..2691449 100644
>> --- a/sys/sys/fcntl.h
>> +++ b/sys/sys/fcntl.h
>> @@ -96,7 +96,7 @@ typedef     __pid_t         pid_t;
>>  #define      O_FSYNC         0x0080          /* synchronous writes */
>>  #endif
>>  #define      O_SYNC          0x0080          /* POSIX synonym for O_FSYNC */
>> -#if __BSD_VISIBLE
>> +#if __POSIX_VISIBLE >= 200809
>>  #define      O_NOFOLLOW      0x0100          /* don't follow symlinks */
>>  #endif
>>  #define      O_CREAT         0x0200          /* create if nonexistent */
>
> This looks good, but I went ahead and made the other new POSIX.1-2008
> things visible as well and removed redundant __BSD_VISIBLE condition
> parts:

It looks good to me, and I have had a subset of this change locally.

>
> Index: sys/sys/fcntl.h
> ===================================================================
> --- sys/sys/fcntl.h     (revision 263842)
> +++ sys/sys/fcntl.h     (working copy)
> @@ -96,7 +96,7 @@ typedef       __pid_t         pid_t;
>  #define        O_FSYNC         0x0080          /* synchronous writes */
>  #endif
>  #define        O_SYNC          0x0080          /* POSIX synonym for O_FSYNC */
> -#if __BSD_VISIBLE
> +#if __POSIX_VISIBLE >= 200809
>  #define        O_NOFOLLOW      0x0100          /* don't follow symlinks */
>  #endif
>  #define        O_CREAT         0x0200          /* create if nonexistent */
> @@ -115,7 +115,7 @@ typedef     __pid_t         pid_t;
>  #endif
>
>  /* Defined by POSIX Extended API Set Part 2 */

I'd also remove this line as well. It looks useless now.

> -#if __BSD_VISIBLE
> +#if __POSIX_VISIBLE >= 200809
>  #define        O_DIRECTORY     0x00020000      /* Fail if not directory */
>  #define        O_EXEC          0x00040000      /* Open for execute only */
>  #endif
> @@ -184,7 +184,7 @@ typedef     __pid_t         pid_t;
>  #endif
>
>  /* Defined by POSIX Extended API Set Part 2 */

See above.

> -#if __BSD_VISIBLE
> +#if __POSIX_VISIBLE >= 200809
>  /*
>   * Magic value that specify the use of the current working directory
>   * to determine the target of relative file paths in the openat() and
[...]

-- 
wbr,
pluknet



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAE-mSOJKycH%2BbzoJroRn3zacxVuhkc6n8CCYpJBL9OonQYuwng>