bug-fileutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Repost: chown: no recursive dereferencing through symlinks?


From: Christopher Wood
Subject: Repost: chown: no recursive dereferencing through symlinks?
Date: Sun, 8 Sep 2002 13:43:15 -0400
User-agent: Mutt/1.4i

[Reposting this because I originally posted it during the fileutils --> 
coreutils transition.]

I've looked through the list archives, and I apologize if I missed a post 
discussing this. I'm not sure whether this behaviour is a feature or a bug. I'm 
not a programmer, so unfortunately can't check the source in a meaningful way. 
Would anyone here know if this behaviour is normal/intended?

Here's what happens on two systems, with slightly different fileutils versions. 
Note how -R behaves differently depending on if I apply the chown to a 
directory or to a symlink to a directory.


address@hidden:/tmp$ uname -a
Linux titanium 2.2.14-5.0smp #1 SMP Tue Mar 7 21:01:40 EST 2000 i686 unknown
address@hidden:/tmp$ chown --version
chown (GNU fileutils) 4.0p
Written by David MacKenzie.z

Copyright (C) 1999 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
address@hidden:/tmp$ mkdir zdir
address@hidden:/tmp$ touch zdir/file
address@hidden:/tmp$ ln -s zdir zln
address@hidden:/tmp$ ls -l
total 2
drwxrwxr-x    2 cwood    develop      4096 Aug  9 15:17 zdir/
lrwxrwxrwx    1 cwood    develop         4 Aug  9 15:18 zln -> zdir/
address@hidden:/tmp$ su
Password: 
address@hidden /tmp]# chown -R -v root zdir
owner of zdir changed to root
owner of zdir/file changed to root
address@hidden /tmp]# chown -R -v cwood zdir
owner of zdir changed to cwood
owner of zdir/file changed to cwood
address@hidden /tmp]# chown -R -v root zln 
owner of zln changed to root
address@hidden /tmp]# chown -R -v cwood zln
owner of zln changed to cwood
address@hidden /tmp]# chown -R -v --dereference root zln
owner of zln changed to root
address@hidden /tmp]# ls -l
total 2
drwxrwxr-x    2 root     develop      4096 Aug  9 15:17 zdir
lrwxrwxrwx    1 cwood    develop         4 Aug  9 15:18 zln -> zdir
address@hidden /tmp]# ls -l zdir
total 0
-rw-rw-r--    1 cwood    develop         0 Aug  9 15:17 file
address@hidden /tmp]# 


address@hidden:/tmp$ uname -a
Linux playdium 2.4.18 #4 SMP Wed Apr 24 18:38:23 EDT 2002 i686 unknown unknown 
GNU/Linux
address@hidden:/tmp$ chown --version
chown (fileutils) 4.1.10
Written by David MacKenzie.

Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
address@hidden:/tmp$ mkdir zdir
address@hidden:/tmp$ touch zdir/file
address@hidden:/tmp$ ln -s zdir zln
address@hidden:/tmp$ ls -l
total 2
drwxrwxr-x    2 cwood    develop      4096 Aug  9 15:24 zdir/
lrwxrwxrwx    1 cwood    develop         4 Aug  9 15:24 zln -> zdir/
address@hidden:/tmp$ su
Password: 
playdium:/tmp# chown -R -v root zdir
changed ownership of `zdir' to root
changed ownership of `zdir/file' to root
playdium:/tmp# chown -R -v cwood zdir
changed ownership of `zdir' to cwood
changed ownership of `zdir/file' to cwood
playdium:/tmp# chown -R -v root zln
changed ownership of `zln' to root
playdium:/tmp# ls -l
total 2
drwxrwxr-x    2 cwood    develop      4096 Aug  9 15:24 zdir
lrwxrwxrwx    1 root     develop         4 Aug  9 15:24 zln -> zdir
playdium:/tmp# chown -R -v cwood zln
changed ownership of `zln' to cwood
playdium:/tmp# chown -R -v --dereference root zln
changed ownership of `zln' to root
playdium:/tmp# ls -l
total 2
drwxrwxr-x    2 root     develop      4096 Aug  9 15:24 zdir
lrwxrwxrwx    1 cwood    develop         4 Aug  9 15:24 zln -> zdir
playdium:/tmp# ls -l zdir
total 0
-rw-rw-r--    1 cwood    develop         0 Aug  9 15:24 file
playdium:/tmp# 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]