Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Nov 2002 08:55:03 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        FreeBSD maillist <freebsd-questions@FreeBSD.ORG>
Subject:   Re: a strange perl problem?
Message-ID:  <20021108085503.GB3028@happy-idiot-talk.infracaninophi>
In-Reply-To: <20021108064710.20902.qmail@web20009.mail.yahoo.com>
References:  <20021108064710.20902.qmail@web20009.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021108085503.GB3028>