Re: Chown script

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

 



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.
*/

Attachment: pgpCSRR1coLI9.pgp
Description: PGP signature


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux