Repository navigation
cp: set the destination's attributes without following a symlink - #16460
abendrothj wants to merge 1 commit into
Conversation
b9e2a67 to
0ce7e8d
Compare
0ce7e8d to
2e55840
Compare
Merging this PR will regress 2 benchmarksWarning uutils has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed. 2 warnings, 1 note
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
2e55840 to
2dd0389
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
2dd0389 to
07d2e43
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Where the libc can't chmod without following, or Linux has neither fchmodat2 nor /proc, cp keeps the following chmod. The /proc fallback chmod -R shares now refuses a symlink. Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
07d2e43 to
b9284c9
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
GNU testsuite comparison: |
Supersedes #13630.
After the copy, cp sets the destination's mode, times and xattrs by name. If the destination is replaced with a symlink after cp has checked it, those changes go to the link's target.
Those steps now refuse to follow a symlink there: the final chmod, the
-pmode, the read-only toggle around the xattr copy, the xattr open, the timestamps, and the SELinux fallback that empties the destination (unless cp was writing through a destination symlink from the start). Where the libc can't chmod without following, or Linux has neitherfchmodat2nor/proc, cp keeps the following chmod.The
/procfallback thatchmod -Rshares (kernels withoutfchmodat2) now refuses a symlink, likefchmodat2. On those kernels each chmod costs about four more syscalls.util/check-safe-traversal.shchecks cp with strace, and CI now builds cp for it.