Skip to content

chown, chgrp: change a directory operand that cannot be read - #15124

Draft
abendrothj wants to merge 3 commits into
uutils:mainfrom
abendrothj:chown-unreadable-dir-operand
Draft

abendrothj wants to merge 3 commits into
uutils:mainfrom
abendrothj:chown-unreadable-dir-operand

Conversation

@abendrothj

@abendrothj abendrothj commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

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

On Linux, a directory operand was changed through a descriptor opened for reading, and when that open failed the change was skipped without a message.

Without -R the directory is now changed like any other file: by name, or through an O_PATH descriptor with --from. Under -R it's still left alone with exit 1, as with GNU 9.12. Test: test_chown_unreadable_dir_operand.

Closes #15114

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 improve performance by 4.17%

2 warnings

⚠️ 65 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

⚠️ 1 benchmark with a significant change ran on different hardware

Its base and head results were measured on machines with a different CPU, core count or memory, so the change might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

⚡ 1 improved benchmark
✅ 114 untouched benchmarks
⏩ 360 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ du_wide_tree[(5000, 500)] 15.9 ms 15.3 ms +4.17%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing abendrothj:chown-unreadable-dir-operand (a3ed451) 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. ↩

@abendrothj
abendrothj force-pushed the chown-unreadable-dir-operand branch from 214b811 to f1ff0e1 Compare October 7, 2026 02:27
Copilot AI balanced review requested due to automatic review settings 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-unreadable-dir-operand branch from f1ff0e1 to d2406f8 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-unreadable-dir-operand branch from d2406f8 to c17a06e 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
@sylvestre

Copy link
Copy Markdown
Contributor

sorry but it needs to be rebased

Comment thread tests/by-util/test_chown.rs Resolved
@abendrothj
abendrothj force-pushed the chown-unreadable-dir-operand branch from c17a06e to 4f8ed95 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.
@abendrothj
abendrothj force-pushed the chown-unreadable-dir-operand branch from 4f8ed95 to a3ed451 Compare November 8, 2026 23:26

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, chgrp: a directory operand that can't be read is skipped silently

3 participants