Skip to content

chmod: print 'could not be accessed' with -v for operands that can't be stat'ed - #15884

Open
emirmrkaljevic wants to merge 1 commit into
uutils:mainfrom
emirmrkaljevic:chmod-verbose-not-accessed
Open

emirmrkaljevic wants to merge 1 commit into
uutils:mainfrom
emirmrkaljevic:chmod-verbose-not-accessed

Conversation

@emirmrkaljevic

Copy link
Copy Markdown
Contributor

Fixes #15883

With -v, GNU chmod prints 'FILE' could not be accessed on stdout after the error when an operand can't be stat'ed (missing, dangling symlink, f/, EACCES). uutils printed nothing, and for a dangling symlink a fixed failed to change mode of ... from 0000 (---------) to 1500 (r-x-----T) line.

  • Moved the existing chmod-verbose-could-not-be-accessed print (used for unreadable directories) into a small report_not_accessed helper and call it for missing, dangling, EACCES and other stat errors. Like GNU it is printed with -v -f and not with -c.
  • Dropped the unused chmod-verbose-failed-dangling string (en-US, fr-FR) and updated the two tests that expected it.
  • New tests: -v with missing f/ f, -v -f, and -c. Output matches GNU 9.12 and 9.7.

Found with behave, a black-box CLI comparison tool, by diffing uutils chmod against GNU coreutils 9.12.

… stat'ed

GNU follows the error with "'FILE' could not be accessed" on stdout for
a missing operand, a dangling symlink, f/ or an EACCES path, even with -f.
Replace the fixed dangling-symlink line with it.

Fixes uutils#15883

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.

chmod -v: missing 'could not be accessed' line for operands that can't be stat'ed

1 participant