On Fri, Aug 08, 2025 at 03:22:58PM +0200, Christian Brauner wrote: > On Thu, Aug 07, 2025 at 02:01:15PM -0700, Josh Triplett wrote: > > I just discovered that opening a file with O_PATH gives an fd that works > > with > > > > utimensat(fd, "", times, O_EMPTY_PATH) > > > > but does *not* work with what futimens calls, which is: > > > > utimensat(fd, NULL, times, 0) > > It's in line with what we do for fchownat() and fchmodat2() iirc. > O_PATH as today is a broken concept imho. O_PATH file descriptors > should've never have gained the ability to meaningfully alter state. I > think it's broken that they can be used to change ownership or mode and > similar. In the absence of having O_PATH file descriptors, what would be the way to modify the properties of a symlink using race-free file-descriptor-based calls rather than filenames? AFAICT, there's no way to get a file descriptor corresponding to a symbolic link without using `O_PATH | O_NOFOLLOW`. It makes sense that a file descriptor for a symbolic link would be able to do inode operations but not file operations.