tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* [SUMMARY] mkdir and group
@ 1996-01-31 10:20 Jukka Jalava
  0 siblings, 0 replies; only message in thread
From: Jukka Jalava @ 1996-01-31 10:20 UTC (permalink / raw)
  To: tru64-unix-managers

Only yesterday I asked:

> In HP-UX (System V UNIXes) when you create a subdirectory with mkdir, > it inherits the users effective ID and GID. In DU (at least OSF/1 3.2)
> it inherits the GID of the parent directory, and not the user! (I take > this is the way to do it in BSD UNIX)
> 
> Using this from command line wouldn't be a major problem, but when 
> it's built into scripts used by a make-system it gets rather tedious.
> 
> Can anyone tell me if there is a way to tell mkdir what UID and GID to
> use?
> 

A Big Heap Of Thanks To:

	alan@nabeth.cxo.dec.com
        Ken Teh <teh@chinook.phy.anl.gov>
	Dan Riley <dsr@lns598.lns.cornell.edu>
        Paul David Fardy <pdf@morgan.ucs.mun.ca>	
	Jarkko.Hietaniemi@hut.fi (Jarkko Hietaniemi)

I was suggested to run the System V environment, but the solution that
works for me lies in the filesystem mount:

> If you mount the file system with the 'nogrpid' option, you'll get the
> SVID semantics.
> 
> Read the man page for mount(8).  The relevant options are grpid and
> nogrpid (the former is the default).  If you mount the filesystem
> using fstab entries like the following samples, you'll get the SysV
> behaviour you were expecting.
> 
>         /dev/rz0d  /usr   ufs    rw,nogrpid 1 2
>         rz3#pkg    /pkg   advfs  rw,nogrpid 1 2
> 
> Note the if you set a directory's setgid-bit, files will inherit the
> directory's group structure.
> 
> We don't use this option, though.  We found that the BSD rules are more
> appropriate to handling groups and shared files.  When we create a
> directory for members of group foobar to share, we want all the files
> in the directory to be owned by group foobar and, hopefully, readable
> and executable (as applicable) to every member of the group.
> 
> The exceptions are usually apply to the creation of new direcotories.
> I find that this is more easily managed than the ongoing problems
> of user creating file with inappropriate group ownership.
>
> Paul Fardy

I have to agree with Paul there, BSD rules have their good sides.
Jarkko had the same solution and copied me the part of the manual:

>   grpid
>       New files inherit the parent directory's group ID.  This is the default
>       and matches BSD's semantics.
> 
>   nogrpid
>       SVID III semantics applied.  For example, if the parent directory's
>       mode bits include IS_GID, then the new file will inherit the parent's
>       group ID.  If IS_GID is off, then it inherits the process group ID.
>
>   ++jhi;

Tried it. Works. Thank you all once more.

-- 

     _____                               Jukka Jalava
    (  	 /       /_   /_   __          System Specialist
    ____/__/  / /__) /__) /  /       Valmet Automation Inc. 
   (___/  (__/_/ (__/ (__(__/(          Tampere FINLAND 
                                 jukka.jalava@vat-vai.valmet.com
                                  tel: +358 31 2668 690  (GMT+2)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-01-31 10:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-01-31 10:20 [SUMMARY] mkdir and group Jukka Jalava

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox