Skip to content

syscall: qualify search-only directory descriptors - #1155

Merged
steadytao merged 2 commits into
masterfrom
search-only-directories
Nov 9, 2026
Merged

steadytao merged 2 commits into
masterfrom
search-only-directories

Conversation

@steadytao

Copy link
Copy Markdown
Member

Summary

Known-name operations beneath searchable but unreadable directories now use a traversal descriptor only when configure proves that it supports lookup, creation, permission revocation, fchdir revocation and O_NOFOLLOW. Native Linux and FreeBSD builds select O_PATH. Current macOS builds select O_SEARCH. Cross-built Linux retains O_PATH; other unverified cross targets remain fail-closed. The result is exposed as search_only_dirs in -VV. Targets without a verified descriptor continue using O_RDONLY and reject traversal when directory read permission is absent. The tests first verify that these transfers fail without creating the destination before reporting the kernel capability as unsupported.

NetBSD 11 removes O_SEARCH during open() and OpenBSD provides no search-only directory open mode. A pathname fallback would reintroduce parent-symlink races for creation, rename and hard-link operations, so no fallback is added.

@steadytao
steadytao merged commit d1a2844 into master Nov 9, 2026
21 checks passed
@steadytao
steadytao deleted the search-only-directories branch November 9, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant