head	1.3;
access;
symbols
	TIGRIS_1_1_0RC2:1.2
	TIGRIS_1_1_0RC1:1.2
	TIGRIS_1_1:1.2.0.14
	TIGRIS_1_0_8:1.2
	TIGRIS_1_0_8RC3:1.2
	TIGRIS_1_0_8RC2:1.2
	TIGRIS_1_0_8RC1:1.2
	TIGRIS_1_0_7:1.2
	TIGRIS_1_0_7RC3:1.2
	TIGRIS_1_0_7RC2:1.2
	TIGRIS_1_0_7RC1:1.2
	TIGRIS_1_0_6:1.2
	TIGRIS_1_0_6RC5:1.2
	TIGRIS_1_0_6RC4:1.2
	TIGRIS_1_0_6RC3:1.2
	TIGRIS_1_0_6RC2:1.2
	TIGRIS_1_0_6RC1:1.2
	TIGRIS_1_0_5:1.2
	TIGRIS_1_0_5RC6:1.2
	TIGRIS_1_0_5RC5:1.2
	TIGRIS_1_0_5RC4:1.2
	TIGRIS_1_0_5RC3:1.2
	TIGRIS_1_0_5RC2:1.2
	TIGRIS_1_0_5RC1:1.2
	TIGRIS_1_0_4:1.2
	TIGRIS_1_0_3:1.2
	TIGRIS_1_0_2:1.2
	TIGRIS_1_0_1:1.2
	TIGRIS_1_0:1.2.0.16
	TIGRIS_1_0_0:1.2
	TIGRIS_1_0_0_RC1:1.2.0.12
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.2
	TIGRIS_0_9_2_3:1.2
	HELM_PEER_PORT_BRANCH:1.1.1.1
	TURBINE_PEER:1.2
	TIGRIS_0_9_2_1:1.2
	TIGRIS_0_9_2:1.2.0.10
	TIGRIS_0_9_0:1.2.0.8
	TIGRIS_0_8_4:1.2.0.6
	NEWHELM:1.1.1.1
	TIGRIS_NOV_12_2000:1.1.1
	OLDHELM:1.2.0.4
	TIGRIS_NOV_11_2000:1.2
	TIGRIS_SEP_13_2000:1.2.0.2
	TIGRIS_BASELINE:1.2;
locks; strict;
comment	@# @;


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

1.2
date	2000.05.31.00.48.59;	author manoj;	state Exp;
branches;
next	1.1;

1.1
date	2000.04.28.01.41.38;	author manoj;	state Exp;
branches
	1.1.1.1;
next	;

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


desc
@@


1.3
log
@remove obsolete/non-functional scripts
@
text
@#!/usr/bin/perl -w

# ================================================================
# Copyright (c) 2000 Collab.Net.  All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 
# 3. The end-user documentation included with the redistribution, if
# any, must include the following acknowlegement: "This product includes
# software developed by Collab.Net (http://www.Collab.Net/)."
# Alternately, this acknowlegement may appear in the software itself, if
# and wherever such third-party acknowlegements normally appear.
# 
# 4. The hosted project names must not be used to endorse or promote
# products derived from this software without prior written
# permission. For written permission, please contact info@@collab.net.
# 
# 5. Products derived from this software may not use the "Tigris" name
# nor may "Tigris" appear in their names without prior written
# permission of Collab.Net.
# 
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ====================================================================
# 
# This software consists of voluntary contributions made by many
# individuals on behalf of Collab.Net.
#

use CGI::Carp;

# Turn off buffering
#$| = 1;

# The list of modules to run 
# Note that order may be important - CVSmodules has to run before
# ApacheModules, for example
my @@modules = qw(CVSloginfo CVSmodules
	       ApacheConfig ApacheModules
	       QmailAlias QmailLists);

my ($query,$arg) = split /\+/, $ENV{"QUERY_STRING"};
die "No command given\n" unless $query;
if ($query !~ /^(add|del)_project|update$/) {
    die "Unknown command $query\n";
}

print "Content-Type: text/html\n\n.\n";
print "<ul>\n";

foreach $module (@@modules) {
    if ($arg) {
        system("../cgi-helpers/$module", $query, $arg);
    }
    else {
        system("../cgi-helpers/$module", $query);
    }
    if ($? >> 8) {
        my $ret = $? >> 8;
        my $sig = $? & 0xff;
        print STDERR "$module $query failed: $ret, $sig\n";
    }
    print "<li>$module $query ran successfully\n";
}
print "</ul>\n";

# XXX - we used to be doing this... oh well
# Only print out the headers at the very end; that way, if something
# goes wrong, Apache spits out a 500 and Java gets an error.
print "Helm successfully updated.\n";

exit(0);
@


1.2
log
@Allow update.cgi to not be a setuid root script, by using
lower-privileged scripts (in cgi-helpers) to do the dirty work.
@
text
@@


1.1
log
@Changes to match the New World Order of paths.
@
text
@d49 1
d51 2
a52 8


# CONFIG - set to /path/t__SANDBOX__/helm/perl
use lib "__SANDBOX__/helm/perl";

use Helm::Database;

use CGI::Carp;
d57 3
a59 11
my @@modules = qw(Helm::CVSloginfo Helm::CVSmodules
	       Helm::ApacheConfig Helm::ApacheModules
	       Helm::QmailAlias Helm::QmailLists);

die "Not running setuid root\n" if $> != 0;

# Fix up some commonly-tainted variables
$ENV{'PATH'} = "/bin:/usr/bin";
delete $ENV{'BASH_ENV'};

my $db = new Helm::Database;
d63 3
d68 1
a69 1
print "<ul>\n";
d71 10
a80 19
    eval "use $module;";
    my $user = $module->user($db);
    my $uid = getpwnam($module->user($db));
    die "Module $module tried to run as root ($user)\n" if $uid == 0;
    $> = $uid;
    die "Not running setuid $user ($uid) for $module (current uid $>)\n"
	unless $> == $uid;
    if ($query eq "add_project") {
	$module->add_project($db, $arg);
	$module->update($db);
	print "<li>add_project on $module returned\n\n";	    
    } elsif ($query eq "del_project") {
	$module->del_project($db, $arg);
	$module->update($db);
	print "<li>del_project on $module returned\n\n";	    
    } elsif ($query eq "update") {
	$module->update($db);
    } else {
	die "Unknown command $query\n";
d82 1
a82 1
    $> = 0;
d86 1
@


1.1.1.1
log
@Merging newhelm tree into helm, as per IZ issue #557.  Previous major version of helm is tagged TIGRIS_NOV_11_2000.
@
text
@d49 8
a58 3
# Turn off buffering
#$| = 1;

d62 11
a72 3
my @@modules = qw(CVSloginfo CVSmodules
	       ApacheConfig ApacheModules
	       QmailAlias QmailLists);
a75 3
if ($query !~ /^(add|del)_project|update$/) {
    die "Unknown command $query\n";
}
d78 1
a79 1

d81 19
a99 10
    if ($arg) {
        system("../cgi-helpers/$module", $query, $arg);
    }
    else {
        system("../cgi-helpers/$module", $query);
    }
    if ($? >> 8) {
        my $ret = $? >> 8;
        my $sig = $? & 0xff;
        print STDERR "$module $query failed: $ret, $sig\n";
d101 1
a101 1
    print "<li>$module $query ran successfully\n";
a104 1
# XXX - we used to be doing this... oh well
@


