Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: redirect STDOUT from system() function

by uzzikie (Sexton)
on Aug 10, 2001 at 12:59 UTC ( [id://103801]=note: print w/replies, xml ) Need Help??


in reply to Re: redirect STDOUT from system() function
in thread redirect STDOUT from system() function

hi

nope i can't use backticks as the script is running setuid...
says the $ENV{path} is insecur
would be a bad idea anyway....

Replies are listed 'Best First'.
Re: Re: Re: redirect STDOUT from system() function
by chromatic (Archbishop) on Aug 10, 2001 at 22:53 UTC
    Either way, Perl spawns a system call. You'll have to untaint a couple of things in %ENV. For example, this fails:
    #!/usr/bin/perl -wT use strict; # delete $ENV{qw( BASH_ENV PATH )}; my $output = `/bin/ls`; print "Output is ($output)\n";
    Uncommenting the appropriate line makes it work, at least on my box. Depending on what's tainted, you may have to do a little more work.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://103801]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-03-29 01:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found