-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
Description
Issue
The new -H flag should traverse symlinks IFF they are passed as arguments to the chmod call.
Other folders should still be traversed as normal.
The recursive behavior is currently not applying to the directory contents of symlink arguments passed to chmod -R -H
Environment
uutils main commit 07cce02
GNU coreutils v9.6
Given
$ mkdir -p example/tmp
$ cd example
$ touch tmp/{a,b}
$ ln -s tmp arg_symlink
$ ls -l
total 4
lrwxrwxrwx 1 me me 3 Apr 2 02:00 arg_symlink -> tmp
drwxrwxr-x 2 me me 4096 Apr 2 02:00 tmp
$ ls -l tmp
total 0
-rw-rw-r-- 1 me me 0 Apr 2 02:00 a
-rw-rw-r-- 1 me me 0 Apr 2 02:00 bExpected
coreutils behavior on 9.6:
$ which chmod
/home/me/Documents/builds/coreutils-9.6/src/chmod
$ chmod u+x -R -H arg_symlink
$ ls -l
total 4
lrwxrwxrwx 1 me me 3 Apr 2 02:00 arg_symlink -> tmp
drwxrwxr-x 2 me me 4096 Apr 2 02:00 tmp
$ ls -l tmp
total 0
-rwxrw-r-- 1 me me 0 Apr 2 02:00 a
-rwxrw-r-- 1 me me 0 Apr 2 02:00 bActual
uutils behavior on main:
$ cargo run -q --features=unix chmod u+x -R -H arg_symlink
$ ls -l
total 4
lrwxrwxrwx 1 me me 3 Apr 2 02:00 arg_symlink -> tmp
drwxrwxr-x 2 me me 4096 Apr 2 02:00 tmp
$ ls -l tmp
total 0
-rw-rw-r-- 1 me me 0 Apr 2 02:00 a
-rw-rw-r-- 1 me me 0 Apr 2 02:00 b