Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!mailrus!wasatch!utah-gr!uplherc!sp7040!obie!wsccs!terry From: terry@wsccs.UUCP (Every system needs one) Newsgroups: comp.unix.questions Subject: Re: halt not by root Summary: real vs. effective uid Keywords: halt ! not root Message-ID: <685@wsccs.UUCP> Date: 28 Sep 88 05:36:10 GMT References: <1128@usfvax2.EDU> <4051@polyslo.CalPoly.EDU> Lines: 28 >>... how can I give halt(8) permission to users other than >>root. We shut the system down at night ... > The real question is, do you NEED to shut this machine down every night? >Is it such a power hog that you can't leave it running??? halt() checks real uid and gid. Your suid root program only has the right euid and egid. How to get around it: Fake it with two programs. The other program just does a halt()... or you could use the regular shell command for it. Either way, it has to be another program. Tricking the halt command by faking your uid gid: system( "sh -c haltprogram"); Magic, eh? | Terry Lambert UUCP: ...{ decvax, ihnp4 } ...utah-cs!century!terry | | @ Century Software OR: ...utah-cs!uplherc!sp7040!obie!wsccs!terry | | SLC, Utah | | These opinions are not my companies, but if you find them | | useful, send a $20.00 donation to Brisbane Australia... | | 'I have an eight user poetic liscence' - me |