From owner-freebsd-questions@FreeBSD.ORG Mon Feb 7 18:30:34 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2235516A4CE for ; Mon, 7 Feb 2005 18:30:34 +0000 (GMT) Received: from outside.taborandtashell.net (sub18-33.member.dsl-only.net [63.105.18.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8AA1B43D48 for ; Mon, 7 Feb 2005 18:30:33 +0000 (GMT) (envelope-from tkelly-freebsd-questions@taborandtashell.net) Received: (qmail 58321 invoked from network); 7 Feb 2005 10:30:30 -0800 Received: from laptop.taborandtashell.net (HELO ?192.168.0.9?) (tkelly@192.168.0.9) by outside.taborandtashell.net with AES256-SHA encrypted SMTP; 7 Feb 2005 10:30:30 -0800 Message-ID: <4207B3C6.7000002@taborandtashell.net> Date: Mon, 07 Feb 2005 10:30:30 -0800 From: Tabor Kelly User-Agent: Mozilla Thunderbird 1.0 (X11/20041230) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Lowell Gilbert References: <200502061646.27199.nedsmailbox2@cox.net> <4206E19B.6050503@taborandtashell.net> <44oeewwj4r.fsf@be-well.ilk.org> <4207A3DF.10301@taborandtashell.net> <44zmygtgt7.fsf@be-well.ilk.org> In-Reply-To: <44zmygtgt7.fsf@be-well.ilk.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: FreeBSD Questions Subject: Re: Very general shutdown question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: tkelly-freebsd-questions@taborandtashell.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2005 18:30:34 -0000 Well thanks, too bad I was planning on using those to make my backup jobs easier. Anyway, here is a quick C program to accomplish the same thing: /* main.c */ #include #include int main(int argc, char *argv[]) { extern char **environ; execve("/sbin/halt", argv, environ); return EXIT_SUCCESS; /* note: we never actually get here */ } to compile it, but type 'gcc main.c' then copy a.out to /halt then 'chown root:wheel /halt' then 'chmod a+s /halt' But when I got done writing and testing the program, I thought to myself: Why not just set /sbin/halt to SUID root? -- Tabor Kelly tkelly-freebsd-questions@taborandtashell.net http://tabor.taborandtashell.net