`install -D file /file` fails and loses the file when the destination's parent is /
还没有人认领这个 Issue。
评估
调研方向
从 install 命令对 -D 选项的处理入手,并使用 install -D -m755 file /file 重现该问题。验证源文件仍然可用、/file 已创建,并且其模式为 0755,与 GNU install 的行为一致。
由索引模型根据 Issue 内容生成。
描述
When the destination of install -D is a single-component absolute path (i.e. its parent directory is the filesystem root /), install fails with a chmod error and does not produce the destination file. GNU coreutils handles this correctly.
Steps to reproduce
ubuntu@resolute-racoon:~$ ls
folder file
ubuntu@resolute-racoon:~$ install -D -m755 file /file
install: No such file or directory
ubuntu@resolute-racoon:~$ ls
folder
the file disappears and is not to be found even in /file.
Environmnet
ubuntu 26.04
install (uutils coreutils) 0.8.0
Expected behavior
Per the GNU install(1) documentation for -D:
-D — create all leading components of DEST except the last, then copy SOURCE to DEST
For DEST = /file, the only leading component except the last is /, which already exists. install should simply copy file to /file and set mode 0755.
- 主要语言
- Rust
- 星标
- 24.1k
- 派生
- 2k
- 平均合并
- 1 天 4 小时
- 30 天内合并 PR
- 371
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
uutils/coreutils 的其他 Issue
-
U - ls
难度 2/5 1-3 小时 新手友好度 70/100
-
U - ls
难度 2/5 1-3 小时 新手友好度 68/100
-
U - tr
难度 2/5 1-3 小时 新手友好度 72/100
-
U - date
难度 2/5 1-3 小时 新手友好度 82/100
-
U - date
难度 2/5 1-3 小时 新手友好度 68/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
gitbutlerapp/gitbutler#15998 · 1 条评论 ·
-
bug triage:deciding
难度 1/5 1 小时以内 新手友好度 88/100
open-telemetry/otel-arrow#4132 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 84/100