bug-coreutils
[Top][All Lists]
Advanced

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

bug in chown --dereference


From: Müller, Folkhard
Subject: bug in chown --dereference
Date: Fri, 17 Sep 2004 11:55:41 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113

Dear to ever it may belong to,


I am talking of:

chown --version chown (coreutils) 5.2.1
Written by David MacKenzie and Jim Meyering.

Copyright (C) 2004 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.



chown --dereference does not that what is expected due to its man/info page

chown --dereference does only work if the owner/group asked for is different form the owner/group of the symbolic link. Otherwise nothing is changed on the target.

Consider the following example:

lrwxrwxrwx  1 folkhard console 6 Sep 17 11:27 sym -> target
-rw-r--r--  1 folkhard utmp    0 Sep 17 11:27 target

chown --dereference folkhard:console sym

lrwxrwxrwx  1 folkhard console 6 Sep 17 11:27 sym -> target
-rw-r--r--  1 folkhard utmp    0 Sep 17 11:27 target    <- no change !!!!


However

chown  folkhard:fp sym

lrwxrwxrwx  1 folkhard fp   6 Sep 17 11:27 sym -> target
-rw-r--r--  1 folkhard utmp 0 Sep 17 11:27 target

chown  -dereference folkhard:console  sym

lrwxrwxrwx  1 folkhard fp      6 Sep 17 11:27 sym -> target
-rw-r--r--  1 folkhard console 0 Sep 17 11:27 target   <- o.k.!


(A work around are  3 chowns as follows):
chown   sym to 'some group different from that what the target shall be'
chown --dereference   sym  to "what is t shall be'
chown   sym to 'what it was'

I expect chgrp to have the same bug, however I did not test!
I came along this bug changing the owner, while operating as root.
This is a 'userspace' example to demonstrate.

Sincerly F.Mueller
--
Dipl. Phys. F.Mueller
EPCOS AG
Surface Acoustic Wave Components Division
SAW RD CAD
P.O. Box 80 17 09 Phone: ++49 89 636 23316
D-81617 Munich Fax: ++49 89 636 27304
Germany mailto: address@hidden
Web: http://www.epcos.com




reply via email to

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