[Samba] O_PATH, FreeBSD & acl_xx_fd

Jeremy Allison jra at samba.org
Tue May 30 17:20:37 UTC 2023


On Tue, May 30, 2023 at 09:57:37AM +0200, Peter Eriksson via samba wrote:
>I’ve been looking at an issue when compiling Samba on FreeBSD 13 with the vfs_zfsacl module.
>
>It seems the logic that detect O_PATH support in Samba doesn’t work right with FreeBSD 13 (since it has implemented O_PATH support) and especially with the acl_get_fd() function. This is a bug (or rather a missing feature) in FreeBSD that there is a patch for now (dunno when it’ll appear in a release version).
>
>However, one question that has surfaced is if Samba also requires support to change/set ACLs via O_PATH-opened file descriptors? I’m trying to test things but figured I’d put this here too if someone with more internal knowledge of the Samba VFS O_PATH-related stuff knows :-)
>
>
>https://bugzilla.samba.org/show_bug.cgi?id=15376
>
>https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271704

Samba uses a horrible hack, as far as I know Linux
specific, to do this.

Once it has a O_PATH fd, it then uses the path
based xattr call on the string /proc/<pid>/fd/<fdnum>
where fdnum is the O_PATH fd we already opened.
This is proven safe.



More information about the samba mailing list