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

未关闭 适合新手
#15,883 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@emirmrkaljevic 已经在做这个了。

开始于 2026年10月26日。

  • #15884 来自 @emirmrkaljevic —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
rust
领域
cli

调研方向

从 chmod 的详细变更报告入手,查找现有消息 chmod-verbose-could-not-be-accessed,该消息用于 -R 期间无法读取的目录。将 stat 调用失败、悬空符号链接以及 -v、-f 和 -c 标志的处理方式与此 issue 中的示例进行比较。完成标准是:-v 按示例报告无法访问的操作数,包括同时使用 -f 时,而 -c 会抑制该行。

由索引模型根据 Issue 内容生成。

描述

U - chmod

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.

主要语言
Rust
星标
24.3k
派生
2.1k
平均合并
1 天 21 小时
30 天内合并 PR
363

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

uutils/coreutils 的其他 Issue

查看 uutils/coreutils 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。