Changing GID inside csh script

Tom Christiansen tchrist at convex.COM
Thu May 16 12:13:57 AEST 1991


>From the keyboard of ratazzie at lonex.radc.af.mil (E. Paul Ratazzi):
:I have checked the FAQ and RTFM'ed on this one.  It seems like it should
:be easy, but I'm having one heck of a time.
:
:OS:  SunOS 4.1.1
:
:Problem:  When a user executes our CAD software, I want all files he
:creates while in the CAD software to have a group id of 'cad'.
:Since these users are normally members of 'staff', the group id has to
:be changed before the CAD software is executed.  I have found that this
:can be done manually (and painfully) by typing 'newgrp cad' and then
:starting the CAD software.

Hmm... I'd thing a setgid front-end C program would work, but you
said it didn't, so barring that....

Sun caved into the evil Death Star on this one, but there are plenty of
ways to make it right.  Do you want this no matter what directory they're
in?  If not, why don't you either mount the stuff with the grpid
mount/fstab option, and/or make the directory setgid cad?  This way you'd
get reasonable group-ownership semantics for created files for a change.

Or you can make a one shot setuid root binary that can be used to setgid
its calling process to group cad via a poke at /dev/mem.

[ Now, I wonder which of the preceding two paragraphs are going to 
  get more people upset. :-) ]


--tom
--
Tom Christiansen		tchrist at convex.com	convex!tchrist
		"So much mail, so little time." 



More information about the Comp.unix.questions mailing list