Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (15 sloc) 469 Bytes
#! /usr/bin/perl
use strict;
# Untaint our arguments (we're very trusting):
my $stderr = shift or die 'No stderr';
my $program = shift or die 'No program';
for ( $stderr, $program ) {
/^(.+)$/ or die;
$_ = $1;
}
open(STDERR, '>', $stderr) or die "Can't redirect STDERR to $stderr: $!";
$0 = $program;
my $rc = do $program;
die "$program fails with return code $rc" if $rc;
die $@ if $@;
die "Couldn't run $program: $!"; # Ack doesn't return, it calls exit
Something went wrong with that request. Please try again.