head	1.2;
access;
symbols
	HELM_PEER_PORT_BRANCH:1.1.1.1 dlr:1.1.1;
locks; strict;
comment	@# @;


1.2
date	2001.02.22.08.19.54;	author edk;	state dead;
branches;
next	1.1;

1.1
date	2001.02.21.00.35.48;	author dlr;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2001.02.21.00.35.48;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.2
log
@remove generated files which were added by accident
@
text
@#!/usr/bin/perl
# (c) 2000 Collab, Inc.

# CGI that allows list scripts to be executed via apache, rather
# than having java do an exec, which causes performance problems.

use CGI;

my $sandbox = '/home/dlr/sandbox';

my $cgi = new CGI;
my $script = $cgi->param('script');
my $params = $cgi->param('params');
my $mailhost = $cgi->param('mailhost');
my $mailuser = $cgi->param('mailuser');

my $scriptdir = "$sandbox/helm/perl/scripts";

# Send back the header.
print $cgi->header("text/plain");

if ($script !~ m/^list\-/) {
	print "not allowed: $script\n";
	exit(1);
};

# do some *simple* validation of the input
if ($params =~ m/[;`\|]/) {
    print "invalid character(s) in input\n";
    exit();
}

# handle ~tigrisq -- since we don't do a shell call (security reasons)
# we need to substitute ~tigrisq ourselves.  bleah.
$params =~ s@@\~tigrisq@@/home/dlr/sandbox/data/helm/qmail@@;

# split the params ourselves so we don't pass potentially unclean
# data to the shell.
$params =~ s/^\s+//;
my @@command = split /\s+/, $params;
if ($mailhost && $mailuser) {
    unshift @@command, 'ssh', '-l', $mailuser, $mailhost, $script;
} else {
    unshift @@command, "$scriptdir/$script";
}

open (IN, "-|") || exec @@command;
while (<IN>) {
    $result .= $_;
}
print "$result";

@


1.1
log
@Initial revision
@
text
@@


1.1.1.1
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@@
