Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site cbrma.UUCP Path: utzoo!watmath!clyde!cbosgd!cbuxc!cbuxb!cbrma!karl From: karl@cbrma.UUCP (Karl Kleinpaste) Newsgroups: net.sources Subject: An alternative to `asroot' Message-ID: <3702@cbrma.UUCP> Date: Sun, 8-Dec-85 06:58:35 EST Article-I.D.: cbrma.3702 Posted: Sun Dec 8 06:58:35 1985 Date-Received: Mon, 9-Dec-85 03:46:29 EST References: <2821@watvlsi.UUCP> Distribution: net Organization: ATT-BL, Columbus Lines: 30 In article <2821@watvlsi.UUCP> ksbszabo@watvlsi.UUCP (Kevin Szabo) writes: >Thus I have written a small command called 'asroot' which will >momentarily give a process root permissions. Here's an alternative to `asroot.' This is a small program which does nothing more than exec a shell (typically csh, for me) with exactly those arguments with which it was called. I have this on multi-user systems, but it lives in a private bin directory with mode 700, so no one but me can get at it unless they're already root or me. Typical usage is % enable which gives me a plain root shell, or % enable -fc 'some random single command to be executed' /* THIS PROGRAM MUST HAVE 04750 PERMISSIONS, AND BE OWNED BY */ /* USER ROOT AND THAT GROUP WHICH IS TO BE ALLOWED TO USE IT. */ main (argc, argv) int argc; char *argv[]; { setgid (5); setuid (0); /* nice (-4); de-comment only if you want to be rude/nasty */ execv ("/bin/csh", argv); } -- Karl Kleinpaste