From owner-freebsd-security Fri Mar 22 16:46:41 2002 Delivered-To: freebsd-security@freebsd.org Received: from walter.dfmm.org (walter.dfmm.org [209.151.233.240]) by hub.freebsd.org (Postfix) with ESMTP id 4EBEF37B417 for ; Fri, 22 Mar 2002 16:46:37 -0800 (PST) Received: (qmail 57991 invoked by uid 1000); 23 Mar 2002 00:46:32 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 23 Mar 2002 00:46:32 -0000 Date: Fri, 22 Mar 2002 16:46:23 -0800 (PST) From: Jason Stone X-X-Sender: To: Fernan Aguero Cc: FreeBSD Security Subject: RE: su -c user command not working In-Reply-To: <657B20E93E93D4118F9700D0B73CE3EA02FFF4C4@goofy.epylon.lan> Message-ID: <20020322162750.T2391-100000@walter> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > Also you can try: su -m man -c catman You can also install djb's daemontools from /usr/ports/sysutils/daemontools and then use setuidgid to run stuff as a different user. Alternatively, you could just use some perl: perl -e '$uid = `id -u man`; $gid = `id -g man`;' \ -e '$( = $) = "$gid $gid"; $> = $< = $uid; exec "myscript";' will run "myscript" with real and effective uid/gid set to "man". -Jason ----------------------------------------------------------------------- I worry about my child and the Internet all the time, even though she's too young to have logged on yet. Here's what I worry about. I worry that 10 or 15 years from now, she will come to me and say "Daddy, where were you when they took freedom of the press away from the Internet?" -- Mike Godwin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: See https://private.idealab.com/public/jason/jason.gpg iD8DBQE8m9BnswXMWWtptckRAt1rAJ97jxZ5NhpCqyWG2VPFqeYxrMNragCZASZy Ni/OXSjKzsEiDiLH9FGE8W8= =qCgg -----END PGP SIGNATURE----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message