halt not by root

Every system needs one terry at wsccs.UUCP
Wed Sep 28 15:36:10 AEST 1988


>>... 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               |



More information about the Comp.unix.questions mailing list