Repository navigation
chmod, chown: check --preserve-root on the directory actually descended into - #14972
Conversation
Merging this PR will not alter performance1 warning, 1 note
Comparing Footnotes
|
|
GNU testsuite comparison: |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
|
Opened #14990. |
b5edd8c to
ab7438f
Compare
|
The SELinux GNU job failed while booting its VM, before any test ran; unrelated to this change. |
0e38dba to
a400b6f
Compare
1066329 to
9989952
Compare
|
rebased on #15030: the gates here are Redox-only now, like the rest of chmod. with the old ones, chmod wouldn't have built on Hurd/AIX once both were merged (main + this failed Hurd clippy). cross-checked with clippy for Hurd and AIX, not run there. back out of draft once ci is green. |
ff34b06 to
2d04aa0
Compare
2d04aa0 to
73df228
Compare
You should be able to compile for AIX now with |
73df228 to
ef4af3b
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
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.
|
Thanks, clippy for |
ef4af3b to
07613f2
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.
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.
|
rebased on main's chmod reporting refactor: errors go through |
07613f2 to
26eaa7a
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.
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.
26eaa7a to
f031f8c
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.
|
a bunch of jobs are failing |
On Linux, a rename between the path lookup and the descent can no longer slip "/" past --preserve-root under -H or -L.
A rename between the checks can no longer send the mode change or the descent into "/", also under -L.
f031f8c to
683dd8a
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.
Follow-up to 07b66ef (uutils#14972): fall back to the path on any open failure instead of an errno allowlist, and keep only the symlink-operand and unopenable-operand tests.
Follow-up to 07b66ef (uutils#14972): fall back to the path only when permissions keep the operand from opening, instead of an errno allowlist, and drop the tests for -h, sandboxed operands and the descriptor count.
Follow-up to 07b66ef (uutils#14972): fall back to the path only when permissions keep the operand from opening, instead of an errno allowlist.
The recursive operand of chmod, chown and chgrp was checked against --preserve-root with its own path lookup, separate from the one the change and the descent used. A rename landing in between could send a -H/-L recursion into "/" after the check had passed.
On Linux, chown/chgrp now also decide on the stat that the operand's descriptor is already verified against. chmod opens the operand, checks that descriptor, and changes its mode through it; it still reopens the directory to descend, like GNU, and only continues if it is the same directory. Under -P this also stops the operand's own mode change from following a symlink swapped in at the directory's name, unless the open itself is refused and chmod goes by path. If the operand can't be opened because it isn't readable yet, the system refuses it (EPERM, as under a macOS sandbox) or this process has no descriptor left, chmod changes its mode by name, as GNU does; other errors are reported.
test_chmod_recursive_descends_only_into_the_directory_it_changedraces a thread that re-points the operand, over 200 runs. Without the change it failed 10 of 10 times on Linux and on macOS; with it, it passed every time (30 on Linux, 20 on macOS), in about 0.3 s on Linux.test_chmod_recursive_operand_refused_by_sandboxruns only on macOS, throughsandbox-exec. Run on macOS and Linux; FreeBSD, Android and Redox are only cross-checked with clippy.Closes #14990