Subject: Re: single user mode file comparisons
To: William Allen Simpson <wsimpson@greendragon.com>
From: Greg A. Woods <woods@weird.com>
List: current-users
Date: 06/09/2003 14:56:22
[ On Monday, June 9, 2003 at 09:59:36 (-0400), William Allen Simpson wrote: ]
> Subject: Re: single user mode file comparisons
>
> It is standard in the same way that IETF (where I once was active) 
> produces standards -- voluntarily.  It appears to have nearly a decade 
> of tweaking.  I've been aware of it for many years, and am unaware of a 
> comparable document produced by another organization.  

That may be true but I don't know of any actual OS vendor who's
referenced it as even a guideline for their distribution.

> > > Of these, chgrp is in /rescue, and required for /bin by FHS.
> > 
> > If "chgrp" is required in /bin by this so-called "FHS" then that
> > document flawed and not really compatible with POSIX-1003.1-2001 since
> > the latter requires that all the "chgrp" functionality be also available
> > through "chown".  This is especially true in single user mode where the
> > user is the superuser and thus the potential restrictions of "chown" do
> > not apply.
>
> I find nothing to support your statements in the online version of 
> POSIX-1003.1-2001, at 
>   http://www.opengroup.org/onlinepubs/007904975/toc.htm

Perhaps you're not reading the right parts?  The synopsis from "chown"
should have sufficed though.  Yes you need to know the owner in order to
successfully only change the group with "chown", but that's not
difficult to figure out.

> > As I understand it "chgrp" is only kept separately defined and has not
> > been deprecated in POSIX-1003.1 so that it can be put in a directory
> > that is by default in the user's path while "chown" can be put off out
> > of harm's way in a "system" directory (/sbin or /usr/sbin) on those
> > systems where non-privileged users are not allowed to change user
> > ownership but rather only group ownership.
>
> I find nothing to support your statements in the online version of 
> POSIX-1003.1-2001. 

     "Some implementations restrict the use of chown to a user with
     appropriate privileges."

(note that's said about "chown(1)", not "chown(2)" the system call)

Of course you won't find anything substantial about /sbin in POSIX, but
from the standard's point of view there's no reason why the above
mentioned restriction could not be implemented by simply retstricing the
contents of /sbin, or perhaps just the /sbin/chown binary to be accessed
and executed only by "a user with appropriate privileges".


> Indeed, that document explicitly notes at:
>   http://www.opengroup.org/onlinepubs/007904975/utilities/chgrp.html
>   "The functionality of chgrp is described substantially through 
>   references to chown(). In this way, there is no duplication of effort 
>   required for describing the interactions of permissions, multiple 
>   groups, and so on."

You're mis-reading that part of the RATIONALE which (by definition)
isn't part of the standard per se.  It's only telling you that they've
been good "programmers" and have avoided making things hard for
themselves and the reader by only defining the terminology and
functionality in one place.


>   "The 4.3 BSD method of specifying both owner and group was included in 
>   this volume of IEEE Std 1003.1-2001 because:
>     ..."
> 
> Implies that the BSD chown isn't implemented on all systems and it's a 
> new feature (with a change in syntax). 

Indeed that is true.  It doesn't change the fact that 1003.1-2001
requires support for the ":group" syntax in chown.


> So, maybe chgrp will go away someday, but I don't see any indication 
> of that in any standard document.

I didn't say it would go away, and indeed I doubt it ever will.  In fact
I said explicitly that it "has not been deprecated".

-- 
								Greg A. Woods

+1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>