Hi, I've been working on a CGI script which is essentially a web interface for a perl script on the machine that does all of the heavy lifting. After getting things working on my own machine, I moved it over to a shared machine so that other people could use it. However, it isn't executing on this new machine. At first, I was getting errors about insecure dependencies and tainting issues, but even after seemingly dealing with those issues the perl script fails to execute after being called. For reference, here's the code on the old machine:

my $detail = ""; $detail = join("", $detail, "perl LGE.pl " ); $detail = join("", $detail, "--target $target ") if defined $targe +t; $detail = join("", $detail, "--port $portnum ") if defined $portnu +m; $detail = join("", $detail, "--interval $interval ") if defined $i +nterval; $detail = join("", $detail, "--protocol $protocol ") if defined $p +rotocol; $detail = join("", $detail, "--source $prmlist ") if defined $prml +ist; $detail = join("", $detail, "--start"); my $command = qx($detail);

And after dealing with the insecure dependency/ tainting issues:

my $detail = ""; $detail = join("", $detail, "/usr/bin/perl LGE.pl " ); $detail = join("", $detail, "--target $target ") if defined $targe +t; $detail = join("", $detail, "--port $portnum ") if defined $portnu +m; $detail = join("", $detail, "--interval $interval ") if defined $i +nterval; $detail = join("", $detail, "--protocol $protocol ") if defined $p +rotocol; $detail = join("", $detail, "--source $prmlist ") if defined $prml +ist; $detail = join("", $detail, "--start"); $ENV{'PATH'} = '/bin:/usr/bin'; delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; untaint($detail); my $command = qx($detail);

It seems like the only real difference is the machine that the code is running on. I went back and ran the new CGI on the old machine and it works. Is it possible that something is preventing my CGI from properly interacting with my script, and if so, any guesses to what it might be?

Thanks,

Trenin


In reply to System Configuration Blocking CGI System Calls? by Trenin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.