bug-coreutils
[Top][All Lists]
Advanced

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

Re: chown should catch null owner:group


From: Eric Blake
Subject: Re: chown should catch null owner:group
Date: Fri, 15 Feb 2008 18:33:12 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to address@hidden on 2/15/2008 4:29 PM:
| P> Is this just an academic worry, or were you really bitten by it?
|
| Yes. About once a year I do chown -R . file, thinking that -R meant
| recursive, oops, I mean "reference"... never expecting it to "work if
| it doesn't work", as with most commands, if it doesn't complain, then
| it must have worked, and one doesn't look back, until a month later
| when one notices some files didn't get written and were now lost due
| to a permission problem.

On one hand, POSIX states that the owner is mandatory, and the fact that
coreutils treats it as optional is an extension.  So coreutils would be
correct if it issued a warning when both owner and group are empty.  On
the other hand, 'chown current_owner file' is not necessarily a no-op -
POSIX allows it to reset setgid bits, for example.  So by extension,
'chown . file' is not necessarily a no-op, and warning when a real action
might be taken seems odd.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHtj1Y84KuGfSFAYARAlIAAKCZIJXCkYSnGYOh9/yBTjKaWDyPSgCg0HBe
4DQeiL73CIf03o+h6UWiGmU=
=wU49
-----END PGP SIGNATURE-----




reply via email to

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