From: gml4410@uk0x08.ggr.co.uk (Lack Mr G M)
Newsgroups: comp.sys.sgi
Subject: A suggestion - any ideas???
Date: 10 Apr 92 17:10:59 GMT


     I  have  a need for a directory to be shared between users (doesn't
everyone?).  However, I can see no real way to do it on unix in the  way
that I want.  Can anyone help.  Here is the problem.

     There  are  (say)  3  users with different ids (a b & c).  They all
share a group (abcgp).  I can create a directory and set the sgid bit on
it  so  that  new  entries  in  the  directory have a group id of abcgp.
However, each file will actually be *owned* by whichever individual user
(a  b  or c) who created the file.  The others therefore can't chmod it.
Even worse is the fact that, unless these users set a  very  lax  umask,
they  can't edit files created by the others (and I do *NOT* consider it
reasonable for them to reset their umask before creating files  in  this
directory and then changing it again afterwards!).


     What I would like is for unix to allow:

1)  the  ability  to  force  a  "umask"  from a directory to all entries
created in that directory, regardless of the creating user's umask. (By
setting a special bit in the mode of a file).

2)  the  ability  to  force  ownership of an entry to be copied from its
parent directory, in the way that group-ownership can be.   (Perhaps  by
setting the suid mode bit on the directory?).

3)  that  when the owner of a file is "anybody" then *any* member of the
group-owner of that entry should be considered as the owner  (for  chmod
etc.).

4)  that  if  a file is owned by "anybody" and by group "allgroups" that
ownership should be extended to other (I can't see any particular use of
this,  but  it  seems  a  natural extension of 3) and I expect *someone*
could find a use for it).


    This would enable me to create a directory like this (ls-ish):

 drpsrws---  1 anybody   abcgp      512  Apr 10 14:03 shared-dir

where (* means a suggested addition):

 d = is a directory
 r = owner-read
*p = owner-write + PROPAGATE UMASK (could use P if no owner-write?)
 s = set owner of new entries to my owner (ie. anybody)
 r = group-read
 w = group-write
 s = set group-owner to my group-owner (ie. abcgp)

*anybody  owner of entry - ownership passed on to group
 abcgp    group-owner    - any member is the owner of this entry

 etc....

     This would mean that *any* member of the abcgp group could create
an entry in this directory.  If the new entry were a directory it would
end up with a "umask" of

  drpsrws---    (ie. a direct copy)

and ownership of:

  anybody   abcgp  (setuid and setgid bits set in parent directory)

If it were a file it would end up with

   rwxrwx---    (ie. setuid/setgid bits removed!)

but with the same ownership.

NOTE: the uid "anybody" and the gid "allgroups" would have to have some
agreed universal value (-3?) (You can't use the -2 nobody/nogroup as
that is used for unvalidated NFS).  Also, the actual text value may not
be ideal ("anybody" really means "anybody in the group"), so you may
wish to suggest something else.



     Would  anyone  like to comment?  Can you see anyway of implementing
any of this at the moment?  Can you see any problems?  Could  *you*  use
such a facility?


     I  am  used  to  the Primos Access Control List (ACL) system, which
makes such things very simple.  Just create a directory, set an  ACL  on
it  for  the  relevant  group or list of ids, giving them ALL rights and
then leave it up to them.  Simple admin....

     I  have  also  heard that AT&T are going to implement ACLs for unix
using an  ACL  database.   Does  anyone  know  anything  about  it?   In
particular,  will  it  pick  up  the  ACL  of the "youngest parent" if a
file-system entry doesn't have an ACL of its own?  By this I mean can  I
set  and  ACL  on,  say  /usr/mygroup/myid,  which  will  apply to *all*
sub-entries of /usr/mygroup/myid which do not have an ACL entry of their
own  (or lie below /usr/mygroup/myid/<something> which has its own ACL).
Again, I am used to this on Primos (you can protect an entire  partition
with  a single ACL at the top of the tree and, just by changing that one
ACL immediately change the protection of *every* entry on the partition)

 -------------------------- Gordon Lack ----------------------------------
 The contents of this message *may* reflect my personal opinion.  They are
 *not* intended to reflect those of my employer, or anyone else.