diff options
| author | Michael Osipov <michaelo@FreeBSD.org> | 2026-09-29 10:24:45 +0000 |
|---|---|---|
| committer | Xavier Beaudouin <kiwi@FreeBSD.org> | 2026-09-29 10:26:37 +0000 |
| commit | 85ffc8cdec79b8c6f77a632021355d564b69e136 (patch) | |
| tree | e474e78e8ed9480ef9c6c86b20ac42edcf73a181 /sysutils/rubygem-parallel-gitlab/(public-mirror) | |
| parent | b163bb5f3743c9f5a1f5bc454fe4417fe913bdb1 (diff) | |
net/samba419, net/samba420, net/samba422 and net/samba423 all carried
a patch (originally 0028-s3-lib-system-add-FreeBSD-proc_fd_pattern.patch
by Timur I. Bakeyev, adapted for Samba 4.20 by Andrea Venturoli) that
teaches sys_have_proc_fds()/sys_proc_fd_path() in source3/lib/system.c
to recognize FreeBSD's fdescfs mount as an equivalent to Linux's
/proc/self/fd. This patch was dropped when net/samba424 was created
and was never carried forward.
Without it, upstream's sys_have_proc_fds() only ever checks
"/proc/self/fd/0", which does not exist on stock FreeBSD, so
fsp->fsp_flags.have_proc_fds is always false. That flag gates the
race-free pathref-fd-to-path resolution branches in
patch-source3_modules_vfs__zfsacl.c and patch-source3_modules_vfs__freebsd.c,
so without it both modules silently fall back to a less secure,
non-race-free path-based lookup instead of the fdescfs-backed path
that samba419's r24fbb5209481 ("Use a simple approach to reconcile
O_PATH and vfs_zfsacl") was built around.
sys_proc_fd_path()'s signature changed from
"const char *sys_proc_fd_path(int fd, char *buf, size_t bufsize)" to
"char *sys_proc_fd_path(int fd, struct sys_proc_fd_path_buf *buf)"
between Samba 4.19 and 4.20, not at 4.24 - net/samba420, 422 and 423's
copies of the 0028 patch already target the current signature and are
unchanged from each other. Samba itself made no further change to this
function between 4.23 and 4.24, so the samba423 patch would have
applied to 4.24 unmodified; this was a plain oversight when the port's
patches were migrated to the modern patch-<path> naming scheme for
net/samba424, not an upstream-driven incompatibility.
Re-add the fdescfs detection logic based on the samba423 patch text.
Also add an explicit bounds check in sys_proc_fd_path(): struct
sys_proc_fd_path_buf is sized tightly for the fixed-length Linux
"/proc/self/fd/<fd>" string (35 bytes), while our FreeBSD pattern is
based on lp_pid_directory() or "/dev", which could in principle exceed
that under an unusual install prefix - snprintf() would silently
truncate rather than overflow, so assert instead of risking a
truncated, wrong path.
PR: 298885
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Approved by: samba (kiwi)
Diffstat (limited to 'sysutils/rubygem-parallel-gitlab/(public-mirror)')
0 files changed, 0 insertions, 0 deletions
