Re: [PATCH] fcntl-h: default O_SEARCH, O_EXEC to O_PATH if available

2012-11-08 Thread Paul Eggert
On 11/07/2012 11:34 PM, Jim Meyering wrote: > + mkdir -mu=rwx,g=rx,o=w,-s,+t t > mkdir: cannot change permissions of 't': Bad file descriptor Thanks for mentioning that. Yes, the O_PATH was the culprit. I backed out most of it, as follows. Arguably this is a Linux kernel bug with fchmod.

Re: [PATCH] fcntl-h: default O_SEARCH, O_EXEC to O_PATH if available

2012-11-07 Thread Jim Meyering
Paul Eggert wrote: > On 11/05/2012 02:02 PM, Eric Blake wrote: > >> Do we really want the ability to open a symlink as an fd >> when using O_EXEC permissions, instead of following the >> symlink into the file that it normally points to? > > Opening the symlink with open ("symlink", O_EXEC) should

Re: [PATCH] fcntl-h: default O_SEARCH, O_EXEC to O_PATH if available

2012-11-05 Thread Paul Eggert
On 11/05/2012 02:02 PM, Eric Blake wrote: > Do we really want the ability to open a symlink as an fd > when using O_EXEC permissions, instead of following the > symlink into the file that it normally points to? Opening the symlink with open ("symlink", O_EXEC) should be OK, since it will follow t

Re: [PATCH] fcntl-h: default O_SEARCH, O_EXEC to O_PATH if available

2012-11-05 Thread Eric Blake
On 11/05/2012 02:56 PM, Paul Eggert wrote: > Linux kernel 2.6.39 introduced O_PATH (see > ) and this is a better fallback > for O_SEARCH and O_EXEC than O_RDONLY, if O_PATH is available. > * doc/posix-headers/fcntl.texi (fcntl.h): Document this. > * lib/fcntl.in.h (

[PATCH] fcntl-h: default O_SEARCH, O_EXEC to O_PATH if available

2012-11-05 Thread Paul Eggert
Linux kernel 2.6.39 introduced O_PATH (see ) and this is a better fallback for O_SEARCH and O_EXEC than O_RDONLY, if O_PATH is available. * doc/posix-headers/fcntl.texi (fcntl.h): Document this. * lib/fcntl.in.h (O_EXEC, O_SEARCH) [O_PATH]: Default to O_PATH. * lib/