bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* Re: XFS reports lchmod failure, but changes file system contents
       [not found]           ` <87wo8rlgml.fsf@mid.deneb.enyo.de>
@ 2020-02-12 20:38             ` Paul Eggert
  0 siblings, 0 replies; only message in thread
From: Paul Eggert @ 2020-02-12 20:38 UTC (permalink / raw)
  To: Florian Weimer, Al Viro
  Cc: linux-xfs, Rich Felker, libc-alpha, Darrick J. Wong,
	Christoph Hellwig, linux-fsdevel, Gnulib bugs

On 2/12/20 12:01 PM, Florian Weimer wrote:
> I assumed that an O_PATH descriptor was not intending to
> confer that capability.

I originally assumed the other way, as I don't see any security reason 
why fchmod should not work on O_PATH-opened descriptors. I see that the 
Linux man page says open+O_PATH doesn't work with fchmod, but that's 
just a bug in the spec.

In Android, the bionic C library has worked around this problem since 
2015 by wrapping fchmod so that it works even when the fd was 
O_PATH-opened. Bionic then uses O_PATH + fchmod to work around the 
fchmodat+AT_SYMLINK_NOFOLLOW problem[1]. glibc (and Gnulib, etc.) could 
do the same. It's the most sane way out of this mess.

[1] 
https://android.googlesource.com/platform/bionic/+/3cbc6c627fe57c9a9783c52d148078f8d52f7b96


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-12 20:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <874kvwowke.fsf@mid.deneb.enyo.de>
     [not found] ` <20200212161604.GP6870@magnolia>
     [not found]   ` <20200212181128.GA31394@infradead.org>
     [not found]     ` <20200212183718.GQ6870@magnolia>
     [not found]       ` <87d0ajmxc3.fsf@mid.deneb.enyo.de>
     [not found]         ` <20200212195118.GN23230@ZenIV.linux.org.uk>
     [not found]           ` <87wo8rlgml.fsf@mid.deneb.enyo.de>
2020-02-12 20:38             ` XFS reports lchmod failure, but changes file system contents Paul Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).