Making multiple group-membership work

Stuart Levy slevy at geom.umn.edu
Sat Apr 20 12:54:26 AEST 1991


Since IRIX 3.3 it's been possible to use the Berkeley feature where a
process could belong to multiple UNIX groups simultaneously, i.e.
you could always use a group-accessible file belonging to group X if /etc/group
lists you as a group X member, without having to use 'newgrp' first.

The only trouble was, this wasn't default behavior -- you had to run
'multgrps' to get a shell that actually belonged to all the groups you were in.
This shell would of course not inherit shell variables, history, running jobs
and so on from your initial login shell -- basically not too useful.

After complaining to SGI & scratching head for a while I came up with the
following kludge.  At the top of ``/etc/cshrc'', insert something like

	if ( ! -f /tmp/multgrps.$$ ) then
		/bin/touch /tmp/multgrps.$$ && exec /bin/multgrps -
	endif
	/bin/rm -f /tmp/multgrps.$$

The /tmp file test ensures multgrps is called exactly once.
(An environment variable won't do, since "multgrps -" erases its environment.)
This works for csh (and tcsh) login & window shells.  It's no help for /bin/sh
users.  Also doesn't help ftp or rsh access, but you could replace ftpd & rshd
with others compiled from Berkeley sources -- from uunet.uu.net, say.

    Stuart



More information about the Comp.sys.sgi mailing list