From owner-freebsd-questions Fri Nov 8 0:55:14 2002 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 DA7C537B404 for ; Fri, 8 Nov 2002 00:55:12 -0800 (PST) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id E4B0543E42 for ; Fri, 8 Nov 2002 00:55:11 -0800 (PST) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost.infracaninophile.co.uk [IPv6:::1]) by smtp.infracaninophile.co.uk (8.12.6/8.12.6) with ESMTP id gA88t8tf003357 for ; Fri, 8 Nov 2002 08:55:08 GMT (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost) by happy-idiot-talk.infracaninophile.co.uk (8.12.6/8.12.6/Submit) id gA88t3ag003356 for freebsd-questions@FreeBSD.ORG; Fri, 8 Nov 2002 08:55:03 GMT Date: Fri, 8 Nov 2002 08:55:03 +0000 From: Matthew Seaman To: FreeBSD maillist Subject: Re: a strange perl problem? Message-ID: <20021108085503.GB3028@happy-idiot-talk.infracaninophi> Mail-Followup-To: Matthew Seaman , FreeBSD maillist References: <20021108064710.20902.qmail@web20009.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021108064710.20902.qmail@web20009.mail.yahoo.com> User-Agent: Mutt/1.5.1i X-Spam-Status: No, hits=-2.5 required=5.0 tests=IN_REP_TO,REFERENCES,SPAM_PHRASE_01_02,USER_AGENT, USER_AGENT_MUTT version=2.43 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Nov 07, 2002 at 10:47:10PM -0800, Vincent Chen wrote: > Hi, all > > I wrote a perl script to destroy gif interface. It has > a line looks like this: > > system("ifconfig","gif0","destroy"); > > yes, this script is running suidperl and has suid bit > set. > > The problem is this script work fine if called under > shell prompt but not working if called by a suidperl > CGI. This, I suspect, is down to one of two causes. The first is simply that the environment that CGI scripts run under is different to what you get under your user account. Make sure that $ENV{PATH} is set appropriately and so forth. As a matter of good programming practice, you should really be using the absolute path "/sbin/ifconfig" in your system call anyway. The second possible cause is the perl taint checking mechanism saving you from yourself. If that is the case, you'll see an "Insecure dependency" error message either in your browser or in /var/log/httpd-error.log See the perlsec(1) man page for details. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message