Path: utzoo!utgpu!attcan!uunet!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.unix.wizards Subject: Re: Need to use newgrp or equivalent Message-ID: <2146@ficc.uu.net> Date: 4 Nov 88 22:10:13 GMT References: <514@voodoo.UUCP> <1843@cbnews.ATT.COM> Distribution: na Organization: SCADA Lines: 16 In article <1843@cbnews.ATT.COM>, lml@cbnews.ATT.COM (L. Mark Larsen) writes: > Assuming you are using the standard /bin/sh, turning on the setuid bit > of /bin/newgrp is unlikely to have any impact since the newgrp command > is a built-in command (also built-in in ksh). If you stop to think about this, you'll see that newgrp can't be a builtin in the shell, unless your shell runs setuid root. What is builtin is a command to exec newgrp (instead of forking and execcing). This, in fact, turns out to be fairly poor behaviour. Here we use a command that works like 'su' instead of like 'login', letting you pop back to your old group id (and environment) when you're done. Implementation is an excersize left to the reader... -- Peter da Silva `-_-' Ferranti International Controls Corporation "Have you hugged U your wolf today?" uunet.uu.net!ficc!peter Disclaimer: My typos are my own damn business. peter@ficc.uu.net