Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Problems with Sys::Syslog and taint

by guice (Scribe)
on May 16, 2000 at 01:42 UTC ( [id://11755] : note . print w/replies, xml ) Need Help??

in reply to Problems with Sys::Syslog and taint

It's required that you untaint the ENV{PATH} when you run any system command line apps via system, exec ot anything of that nature.
local %ENV = (PATH => '/bin');
Works like mdillon pointed out. It's actually better than what I was using which was:
local $ENV{'PATH'} = '/bin';
His code will clear out ENV before it sets that path. Anyhow, localizing ENV and setting the PATH is required for tainted scripts that use system calls. This makes sure you don't have some path in the ENV that you don't know about and can be explioted by others.

-- philip
We put the 'K' in kwality!

Replies are listed 'Best First'.
RE: Re: Problems with Sys::Syslog and taint
by mdillon (Priest) on May 16, 2000 at 02:01 UTC
    i decided to completely localize %ENV because taint mode was complaining about my $ENV{BASH_ENV}. i figured it was best to completely redefine the environment to avoid individual errors like this.
      What ever works, what I say :)