uutils/coreutils

`chmod` and `chown` do not detect symlink cycles

已關閉

#11,614 建立於 2026年4月3日

 (1 則留言) (0 個反應) (0 位負責人)Rust (1,981 個分叉)batch import
U - chgrpU - chmodU - chowngood first issuereported-canonical-2

倉庫指標

星標
 (23,893 顆星)
PR 合併指標
 (平均合併 5天 23小時) (30 天內合併 239 個 PR)

描述

root@b082d601e194:/tmp# chmod --version
chmod (GNU coreutils) 9.7
Packaged by Debian (9.7-3)
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie and Jim Meyering.
root@b082d601e194:/tmp# chown --version
chown (GNU coreutils) 9.7
Packaged by Debian (9.7-3)
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie and Jim Meyering.
root@b082d601e194:/tmp# mkdir -p /tmp/a/b/c && ln -s /tmp/a /tmp/a/b/c/d
root@b082d601e194:/tmp# chmod -vRL +r /tmp/a
mode of '/tmp/a' retained as 0755 (rwxr-xr-x)
mode of '/tmp/a/b' retained as 0755 (rwxr-xr-x)
mode of '/tmp/a/b/c' retained as 0755 (rwxr-xr-x)
mode of '/tmp/a/b/c/d' retained as 0755 (rwxr-xr-x)
root@b082d601e194:/tmp# chown -vRL 0 /tmp/a
ownership of '/tmp/a/b/c/d' retained as root
ownership of '/tmp/a/b/c' retained as root
ownership of '/tmp/a/b' retained as root
ownership of '/tmp/a' retained as root
root@03081849be59:/tmp# chmod --version
chmod (uutils coreutils) 0.6.0
root@03081849be59:/tmp# chown --version
chown (uutils coreutils) 0.6.0
root@03081849be59:/tmp# mkdir -p /tmp/a/b/c && ln -s /tmp/a /tmp/a/b/c/d
root@03081849be59:/tmp# chmod -vRL +r /tmp/a | head -n10
mode of '/tmp/a' retained as 0755 (rwxr-xr-x)
mode of '/tmp/a/b' retained as 0755 (rwxr-xr-x)
mode of '/tmp/a/b/c' retained as 0755 (rwxr-xr-x)
mode of '/tmp/a/b/c/d' retained as 0755 (rwxr-xr-x)
mode of '/tmp/a/b/c/d/b' retained as 0755 (rwxr-xr-x)
mode of '/tmp/a/b/c/d/b/c' retained as 0755 (rwxr-xr-x)
mode of '/tmp/a/b/c/d/b/c/d' retained as 0755 (rwxr-xr-x)
mode of '/tmp/a/b/c/d/b/c/d/b' retained as 0755 (rwxr-xr-x)
mode of '/tmp/a/b/c/d/b/c/d/b/c' retained as 0755 (rwxr-xr-x)
mode of '/tmp/a/b/c/d/b/c/d/b/c/d' retained as 0755 (rwxr-xr-x)
root@03081849be59:/tmp# chown -vRL 0 /tmp/a 2>&1 | head -n10
chown: ownership of '/tmp/a' retained as root:root
chown: ownership of '/tmp/a/b' retained as root:root
chown: ownership of '/tmp/a/b/c' retained as root:root
chown: ownership of '/tmp/a/b/c/d' retained as root:root
chown: ownership of '/tmp/a/b/c/d/b' retained as root:root
chown: ownership of '/tmp/a/b/c/d/b/c' retained as root:root
chown: ownership of '/tmp/a/b/c/d/b/c/d' retained as root:root
chown: ownership of '/tmp/a/b/c/d/b/c/d/b' retained as root:root
chown: ownership of '/tmp/a/b/c/d/b/c/d/b/c' retained as root:root
chown: ownership of '/tmp/a/b/c/d/b/c/d/b/c/d' retained as root:root

貢獻者指南