From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96076327921570.tru64-unix-managers.marc@archive.invalid> From: Jukka Jalava Date: Wed, 31 Jan 1996 10:20:39 +0000 To: tru64-unix-managers Subject: [SUMMARY] mkdir and group X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96076327921570 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 Dan Riley Paul David Fardy 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)