Chown script
Tim Waugh
twaugh at redhat.com
Fri Oct 22 09:02:21 UTC 2004
On Thu, Oct 21, 2004 at 11:55:10PM -0700, Nifty Hat Mitch wrote:
> It is unclear to me what happens to all the permutations if you have
> two users (boss and boss.hog) and two groups (hog and xthug).
>
> chown -r boss.hog:xthug ~boss.hog
> chown -r boss.hog:hog ~boss.hog
> chown -r boss.hog ~boss.hog
> chown -r boss:hog ~boss.hog
> ....?
>
See the source code:
/* If there's no colon but there is a `.', then first look up the
whole spec, in case it's an OWNER name that includes a dot.
If that fails, then we'll try again, but interpreting the `.'
as a separator. This is a compatible extension to POSIX, since
the POSIX-required behavior is always tried first. */
> Is the below broken? What would a script do?
>
> chown -r boss.hog.hog ~boss.hog
Yes, it is broken, as it does not use the POSIX separator and so its
effects are implementation-defined. (With GNU coreutils I think it
will actually fail because there is no group 'hog.hog'.)
Tim.
*/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20041022/d33e7769/attachment-0001.sig>
More information about the fedora-list
mailing list