From owner-freebsd-questions Fri Jan 1 07:04:05 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA20890 for freebsd-questions-outgoing; Fri, 1 Jan 1999 07:04:05 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from alice.gba.oz.au (gba-254.tmx.com.au [203.9.155.254]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id HAA20874 for ; Fri, 1 Jan 1999 07:04:00 -0800 (PST) (envelope-from gjb@acm.org) Received: (qmail 16318 invoked by uid 1001); 1 Jan 1999 14:31:11 -0000 Message-ID: <19990101143111.16317.qmail@alice.gba.oz.au> X-Posted-By: GBA-Post 1.03 20-Sep-1998 X-PGP-Fingerprint: 5A91 6942 8CEA 9DAB B95B C249 1CE1 493B 2B5A CE30 Date: Sat, 02 Jan 1999 00:31:11 +1000 From: Greg Black To: "Ronald F. Guilmette" Cc: questions@FreeBSD.ORG Subject: Re: /bin/sh -p broken? References: <32180.915166033@monkeys.com> In-reply-to: <32180.915166033@monkeys.com> of Thu, 31 Dec 1998 20:47:13 PST Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Is it just me or does the -p option to /bin/sh not actually do what it > it is supposed to do? Seems not to. > This is really quite handy, because it allows you to write setuid shell > scripts.... and I happen to be in need of exactly such a thing right at > the moment. If you really need to do this (which I think is a bad idea, but that's not of interest here), it's a matter of a few seconds to write a setuid C wrapper program like this: #include #include int main(void) { setuid(geteuid()); /* optional */ system("my_shell_script"); return 0; } -- Greg Black To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message