syscall: use O_PATH for held directory traversal - #1065
Conversation
Use O_PATH on Linux for directory descriptors used only for path traversal, fchdir(), or as *at() parents. Reopen final directory endpoints with the caller-requested access mode and retain the existing O_RDONLY fallback elsewhere. Add coverage for exact sources and readable descendants beneath search-only directories, known-file creation beneath write/search-only destinations, and retained refusal to enumerate unreadable directories. Fixes RsyncProject#1064.
05c00c3 to
c512980
Compare
|
This looks good Thanks! I think there is still some cases like this not covered in the source which I still didn't confirm, which if confirmed, we should step back and find a broader solution that covers all edge cases cleanly ( like fixing |
|
It does LGTM. I'll leave this for a bit while @seks99x looks for some possible untouched cases but overall good to merge in about 2-3 days if unconfirmed. |
|
Sorry for the delay. I'll confirm this tomorrow |
|
Automated review note — AI-generated (Claude), validated against the live diff. Please sanity-check before acting. Reviewed at head
(seks99x/steadytao have already LGTM'd; none of the above blocks that.) |
Use
O_PATHon Linux for directory descriptors used only for path traversal,fchdir(), or as*at()parents. Reopen final directory endpoints with the caller-requested access mode and retain the existingO_RDONLYfallback elsewhere.Add coverage for exact sources and readable descendants beneath search-only directories, known-file creation beneath write/search-only destinations, and retained refusal to enumerate unreadable directories.
Fixes #1064.