head	1.4;
access;
symbols
	TIGRIS_1_1_0RC2:1.3
	TIGRIS_1_1_0RC1:1.3
	TIGRIS_1_1:1.3.0.14
	TIGRIS_1_0_8:1.3
	TIGRIS_1_0_8RC3:1.3
	TIGRIS_1_0_8RC2:1.3
	TIGRIS_1_0_8RC1:1.3
	TIGRIS_1_0_7:1.3
	TIGRIS_1_0_7RC3:1.3
	TIGRIS_1_0_7RC2:1.3
	TIGRIS_1_0_7RC1:1.3
	TIGRIS_1_0_6:1.3
	TIGRIS_1_0_6RC5:1.3
	TIGRIS_1_0_6RC4:1.3
	TIGRIS_1_0_6RC3:1.3
	TIGRIS_1_0_6RC2:1.3
	TIGRIS_1_0_6RC1:1.3
	TIGRIS_1_0_5:1.3
	TIGRIS_1_0_5RC6:1.3
	TIGRIS_1_0_5RC5:1.3
	TIGRIS_1_0_5RC4:1.3
	TIGRIS_1_0_5RC3:1.3
	TIGRIS_1_0_5RC2:1.3
	TIGRIS_1_0_5RC1:1.3
	TIGRIS_1_0_4:1.3
	TIGRIS_1_0_3:1.3
	TIGRIS_1_0_2:1.3
	TIGRIS_1_0_1:1.3
	TIGRIS_1_0:1.3.0.16
	TIGRIS_1_0_0:1.3
	TIGRIS_1_0_0_RC1:1.3.0.12
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.3
	TIGRIS_0_9_2_3:1.3
	HELM_PEER_PORT_BRANCH:1.1.1.1
	TURBINE_PEER:1.3
	TIGRIS_0_9_2_1:1.3
	TIGRIS_0_9_2:1.3.0.10
	TIGRIS_0_9_0:1.3.0.8
	TIGRIS_0_8_4:1.3.0.6
	TIGRIS_NOV_12_2000:1.3
	OLDHELM:1.3.0.4
	TIGRIS_NOV_11_2000:1.3
	TIGRIS_SEP_13_2000:1.3.0.2
	TIGRIS_BASELINE:1.3;
locks; strict;
comment	@# @;


1.4
date	2001.08.14.21.56.40;	author edk;	state dead;
branches;
next	1.3;

1.3
date	2000.07.26.21.11.32;	author ed;	state Exp;
branches;
next	1.2;

1.2
date	2000.07.13.08.38.02;	author ed;	state Exp;
branches;
next	1.1;

1.1
date	2000.07.13.08.08.57;	author ed;	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.4
log
@remove obsolete/non-functional scripts
@
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 = '__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@@__MAIL_ROOT__@@;

# 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.3
log
@use __MAIL_ROOT__ token.  also, use the $scriptdir variable.  untested.
@
text
@@


1.2
log
@also handle ~tigrisq according to the sandboxing stuff
@
text
@d35 1
a35 1
$params =~ s@@\~tigrisq@@__SANDBOX__/data/helm/qmail@@;
d44 1
a44 1
    unshift @@command, "$sandbox/helm/perl/scripts/$script";
@


1.1
log
@maillist.cgi needs __SANDBOX__ to be cooked in.
@
text
@d33 4
@


1.1.1.1
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@a32 4
# handle ~tigrisq -- since we don't do a shell call (security reasons)
# we need to substitute ~tigrisq ourselves.  bleah.
$params =~ s@@\~tigrisq@@__MAIL_ROOT__@@;

d40 1
a40 1
    unshift @@command, "$scriptdir/$script";
@


