in reply to System Configuration Blocking CGI System Calls?

untaint($detail);

Where did you learn about taint? That is the wrong way to untaint if you're going to use the shell (qx), so you should avoid the shel with system

The easy way

sub GetLGE { use Capture::Tiny qw/ capture /; local %ENV; delete @ENV{'PATH', 'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; $ENV{'PATH'} = '/bin:/usr/bin'; my @args = ( $^X, 'LGE.cgi' ); push @args, ...; untaint($_) for @args; my($stdout, $stderr, $exit) = capture { system { $args[0] } @args; };; if( $exit ){ die "got the exit( $exit ) and stderr: $stderr\n "; } return $stdout; }

The other way is String::ShellQuote

  • Comment on Re: System Configuration Blocking CGI System Calls? ( shell escapes)
  • Download Code