Skip to content

chown, chgrp: report -R files that cannot be stat'd with -v - #15126

Draft
abendrothj wants to merge 5 commits into
uutils:mainfrom
abendrothj:chown-verbose-failures
Draft

abendrothj wants to merge 5 commits into
uutils:mainfrom
abendrothj:chown-verbose-failures

Conversation

@abendrothj

@abendrothj abendrothj commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Based on #15125; only the last commit is new here.

On Linux, chown -R -v printed no "failed to change ownership of ..." line for a file below the operand whose owner couldn't be read, such as a dangling link under -H or -L, nor for an unreadable -R operand. GNU 9.12 prints one for each, as it does for an operand. Other platforms still walk with walkdir here and get this with #15128.

These now get the operand's line, on stdout since #16239, with "group" for chgrp. The line names only the new owner, as GNU's does for an unreadable -R operand, and that operand gets only this line, whatever --from says. Tests: test_chown_verbose_reports_dangling_symlink_under_big_l, test_chgrp_verbose_reports_dangling_symlink_under_big_l, test_chown_verbose_reports_unreadable_dir_operand.

Closes #15115

Copilot AI balanced review requested due to automatic review settings October 6, 2026 07:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codspeed

codspeed Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 63 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 115 untouched benchmarks
⏩ 360 skipped benchmarks1


Comparing abendrothj:chown-verbose-failures (1d5d2da) with main (bbef561)

Open in CodSpeed

Footnotes

  1. 360 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Comment thread src/uucore/src/lib/features/perms.rs Resolved
Comment thread tests/by-util/test_chown.rs Resolved
Copilot AI balanced review requested due to automatic review settings October 7, 2026 02:27
@abendrothj
abendrothj force-pushed the chown-verbose-failures branch from 3fd3860 to b99a774 Compare October 7, 2026 02:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@abendrothj
abendrothj force-pushed the chown-verbose-failures branch from b99a774 to efea4f3 Compare October 7, 2026 08:02
Copilot AI balanced review requested due to automatic review settings October 7, 2026 08:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@abendrothj
abendrothj force-pushed the chown-verbose-failures branch from efea4f3 to a37ca9a Compare October 12, 2026 11:38
Copilot AI balanced review requested due to automatic review settings October 12, 2026 11:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@abendrothj
abendrothj marked this pull request as draft October 23, 2026 07:30
@abendrothj
abendrothj force-pushed the chown-verbose-failures branch from a37ca9a to 6383ddd Compare November 7, 2026 06:33
The error itself stays on stderr, as in GNU. On Linux, files below a -R
operand now get the line too.
On Linux the file is held with O_PATH, rechecked and changed through
that descriptor, so a rename after the check no longer redirects it.
On Linux it was skipped without a message; it is now changed by name,
or held with O_PATH under --from. -R still leaves it alone, as in GNU.
--from and -v used the link's owner, not the target that is changed.
A link whose target cannot be stat'd is now reported and left alone.
A dangling link under -H or -L, or an unreadable -R operand, got no
"failed to change" line from -v.
@abendrothj
abendrothj force-pushed the chown-verbose-failures branch from 6383ddd to 1d5d2da Compare November 8, 2026 23:26
@abendrothj abendrothj changed the title chown, chgrp: report failed -R changes with -v as for operands chown, chgrp: report -R files that cannot be stat'd with -v Nov 8, 2026

This branch has not been deployed

No deployments
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.

chown -R -v: no failure line for entries below the operand

3 participants