chown, chgrp: 'cannot dereference' instead of 'cannot access' for a missing operand
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
Research direction
Start with tests/by-util/test_chown.rs, especially the commented-out assertion in test_chown_file_notexisting, then inspect the chown and chgrp error handling it exercises. Add coverage for missing operands and the f/ case, while preserving the expected “cannot dereference” wording for dangling symlinks; done when the tests pass for both utilities.
Written by the indexing model from the issue text.
Description
For a missing operand, chown and chgrp say "cannot dereference" where GNU says "cannot access". GNU only uses "cannot dereference" when the operand is a symlink whose target can't be reached.
$ touch f
$ chown "$(id -u)" f/ nosuch/x # GNU coreutils 9.12
chown: cannot access 'f/': Not a directory
chown: cannot access 'nosuch/x': No such file or directory
$ uu-chown "$(id -u)" f/ nosuch/x
chown: cannot dereference 'f/': Not a directory
chown: cannot dereference 'nosuch/x': No such file or directory
chgrp behaves the same way. A dangling symlink (ln -s missing l; chown "$(id -u)" l) gives "cannot dereference" in both, which is correct. tests/by-util/test_chown.rs already has a commented-out assertion for this in test_chown_file_notexisting.
Found with behave, a tool that records a CLI's behaviour and replays it against another implementation.
- Dominant language
- Rust
- Stars
- 24.3k
- Forks
- 2.1k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 357
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from uutils/coreutils
-
ls: `--block-size=0` is accepted when `--si` comes laterPossibly taken @Logic769 claimed this today. Opengood first issue U - ls
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
B - high priority U - ln
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
uutils/coreutils#15980 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
uutils/coreutils#15962 · 3 comments ·
Maintainers usually reply within 1 day
-
B - high priority U - tr
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
U - df
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
All issues in uutils/coreutils
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
memory_patch_page drops the `#` of headings like `## Notes on C#`Possibly taken @viniciusdsandrade claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
akitaonrails/ai-memory#1859 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
wealthfolio/wealthfolio#2376 ·
Maintainers usually reply within 1 day
-
kind/bug kind/security
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
spiceai/spiceai#15826 · 1 comment ·
Maintainers usually reply within 1 day
-
area:cli bug dotnet good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day