FreeBSD's openat supports an O_RESOLVE_BENEATH flag which limits path resolution to occur within the starting directory. We should use it when available.
I'm not sure when O_RESOLVE_BENEATH was added; we may need to support a fallback on older FreeBSDs.
FreeBSD's
openatsupports anO_RESOLVE_BENEATHflag which limits path resolution to occur within the starting directory. We should use it when available.I'm not sure when
O_RESOLVE_BENEATHwas added; we may need to support a fallback on older FreeBSDs.