From owner-freebsd-questions Thu Sep 17 13:46:30 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA24903 for freebsd-questions-outgoing; Thu, 17 Sep 1998 13:46:30 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from resnet.uoregon.edu (resnet.uoregon.edu [128.223.144.32]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA24776 for ; Thu, 17 Sep 1998 13:46:01 -0700 (PDT) (envelope-from dwhite@resnet.uoregon.edu) Received: from localhost (dwhite@localhost) by resnet.uoregon.edu (8.8.8/8.8.8) with ESMTP id NAA03876; Thu, 17 Sep 1998 13:45:30 -0700 (PDT) (envelope-from dwhite@resnet.uoregon.edu) Date: Thu, 17 Sep 1998 13:45:30 -0700 (PDT) From: Doug White To: Jordan Krushen cc: freebsd-questions@FreeBSD.ORG Subject: Re: Setuid shell script problem In-Reply-To: <000201bde1a0$82062660$0300000a@oblivion.purplemedia.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 16 Sep 1998, Jordan Krushen wrote: > I have a setuid shell script which doesn't seem to be running as the owner's > uid.. I'm sure I'm missing something, and I'm not sure what. Could anyone > help this new-to-suid-scripts user get this to work? I know this a > script-specific thing.. if i copy /usr/bin/id to my home dir and make it run > suid root, I get: suid shell scripts are a *bad* idea. In addition the system ignores the suid bit if you try to run scripts directly. Use the command sh . ./test instead. > uid=1000(wired) euid=0(root) gid=1000(wired) groups=1000(wired), 0(wheel), > 7(bin), 1011(samba), 1024(admin) > > which is correct, but through the script I get the following: > > # ls -l test > -rwsr-x--- 1 root bin 13 Sep 16 01:34 test > > # cat test > #!/bin/sh - > /usr/bin/id > > # ./test > uid=1000(wired) gid=1000(wired) groups=1000(wired), 0(wheel), 7(bin), > 1011(samba), 1024(admin) > Doug White Internet: dwhite@resnet.uoregon.edu | FreeBSD: The Power to Serve http://gladstone.uoregon.edu/~dwhite | www.freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message