Skip to content

chown -h doesn't work when the target is a directory #11887

@datamuc

Description

@datamuc
root@4a83d918d81a:/tmp/test# ls -ld * /root /root/.profile
drwx------ 1 root root 4096 Apr 13 03:43 /root
-rw-r--r-- 1 root root  132 Dec  4 15:35 /root/.profile
lrwxrwxrwx 1 root root   14 Apr 17 11:29 profile -> /root/.profile
lrwxrwxrwx 1 root root    5 Apr 17 11:30 root -> /root

root@4a83d918d81a:/tmp/test# chown -h nobody *
root@4a83d918d81a:/tmp/test# ls -ld * /root /root/.profile
drwx------ 1 nobody root 4096 Apr 13 03:43 /root
-rw-r--r-- 1 root   root  132 Dec  4 15:35 /root/.profile
lrwxrwxrwx 1 nobody root   14 Apr 17 11:29 profile -> /root/.profile
lrwxrwxrwx 1 root   root    5 Apr 17 11:30 root -> /root




root@4a83d918d81a:/tmp/test# chown -h root *
root@4a83d918d81a:/tmp/test# ls -ld * /root /root/.profile
drwx------ 1 root root 4096 Apr 13 03:43 /root
-rw-r--r-- 1 root root  132 Dec  4 15:35 /root/.profile
lrwxrwxrwx 1 root root   14 Apr 17 11:29 profile -> /root/.profile
lrwxrwxrwx 1 root root    5 Apr 17 11:30 root -> /root

root@4a83d918d81a:/tmp/test# gnuchown -h nobody *
root@4a83d918d81a:/tmp/test# ls -ld * /root /root/.profile
drwx------ 1 root   root 4096 Apr 13 03:43 /root
-rw-r--r-- 1 root   root  132 Dec  4 15:35 /root/.profile
lrwxrwxrwx 1 nobody root   14 Apr 17 11:29 profile -> /root/.profile
lrwxrwxrwx 1 nobody root    5 Apr 17 11:30 root -> /root




root@4a83d918d81a:/tmp/test# chown --version; gnuchown --version
chown (uutils coreutils) 0.8.0
chown (GNU coreutils) 9.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions