chmod -v: missing 'could not be accessed' line for operands that can't be stat'ed
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start with chmod's verbose change reporting and search for the existing chmod-verbose-could-not-be-accessed message used for unreadable directories during -R. Compare the handling of failed stat calls, dangling symlinks, and the -v, -f, and -c flags against the examples in this issue. Done when -v reports inaccessible operands as shown, including with -f, while -c suppresses the line.
Written by the indexing model from the issue text.
Description
With -v, GNU chmod (9.7 and 9.12) follows a failure to stat an operand with a line on stdout saying it could not be accessed. uutils prints nothing for a missing operand, f/ or an EACCES path, and for a dangling symlink it prints a fixed, made-up mode change instead.
$ touch f; ln -s nowhere dang
$ chmod -v 644 missing f/ f
chmod: cannot access 'missing': No such file or directory
chmod: cannot access 'f/': Not a directory
'missing' could not be accessed
'f/' could not be accessed
mode of 'f' retained as 0644 (rw-r--r--)
$ chmod -v 755 dang
chmod: cannot operate on dangling symlink 'dang'
'dang' could not be accessed
uutils (main):
$ coreutils chmod -v 644 missing f/ f
chmod: cannot access 'missing': No such file or directory
chmod: cannot access 'f/': Not a directory
mode of 'f' retained as 0644 (rw-r--r--)
$ coreutils chmod -v 755 dang
chmod: cannot operate on dangling symlink 'dang'
failed to change mode of 'dang' from 0000 (---------) to 1500 (r-x-----T)
In GNU this is describe_change with CH_NO_STAT. It is printed with -v even with -f, but not with -c. uutils already prints chmod-verbose-could-not-be-accessed for unreadable directories during -R.
Found with behave, a black-box CLI comparison tool, by diffing uutils chmod against GNU coreutils 9.12.
- 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
-
fmt: stops at an unreadable file operand and says only 'read error' for a directoryPossibly taken @emirmrkaljevic claimed this 1 day ago. OpenU - fmt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
shuf: exhausted random source destroys the input during an in-place shufflePossibly taken @limadog9 claimed this 1 day ago. OpenU - shuf
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
paste: serial mode exhausts file descriptors by opening every input simultaneouslyPossibly taken @binhvq claimed this 1 day ago. OpenU - paste
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
unexpand: final newline prevents conversion of leading Unicode blanksPossibly taken @Ybucaille claimed this 1 day ago. OpenU - unexpand
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
chown, chgrp: 'cannot dereference' instead of 'cannot access' for a missing operandPossibly taken @emirmrkaljevic claimed this 2 days ago. OpenU - chgrp U - chown
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
All issues in uutils/coreutils
Similar issues
-
desktop documentation
Difficulty 1/5 Under an hour Newbie friendliness 90/100
vfarcic/dot-agent-deck#2008 ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 1/5 Under an hour Newbie friendliness 85/100
pbakaus/impeccable#1210 ·
Maintainers usually reply within 1 day
-
area: ci priority: P4 ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
shep-pm/shep#1249 · 1 comment ·
Maintainers usually reply within 1 day
-
L: javascript
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dependabot/dependabot-core#16744 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nautechsystems/nautilus_trader#5486 · 1 comment ·
Maintainers usually reply within 1 day