Commit 456220c2 authored by Robert Ricci's avatar Robert Ricci

Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel

parents 6ca39f68 4a161c3d
......@@ -85,10 +85,10 @@ evproxyplab.o: evproxyplab.cc
$(CPPC) $(CFLAGS) -c $<
evproxyplab-debug: evproxyplab.o ../lib/libevent.a ../lib/event.h
$(CPPC) $(LDFLAGS) -static -o $@ evproxyplab.o $(LIBS)
$(CPPC) $(LDFLAGS) -o $@ evproxyplab.o $(LIBS)
eventping-debug: eventping.o
$(CC) $(LDFLAGS) -static -o $@ eventping.o -pthread $(LIBS)
$(CC) $(LDFLAGS) -o $@ eventping.o -pthread $(LIBS)
$(PROGRAMS): ../lib/libevent.a ../lib/event.h
......
......@@ -37,6 +37,7 @@ CREATE TABLE `geni_authorities` (
`created` datetime default NULL,
`expires` datetime default NULL,
`type` enum('sa','ma','ch','cm','ses') NOT NULL default 'sa',
`disabled` tinyint(1) NOT NULL default '0',
`url` tinytext,
`urn` tinytext,
PRIMARY KEY (`uuid`),
......
#!/usr/bin/perl -wT
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2009 University of Utah and the Flux Group.
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# All rights reserved.
#
package GeniAuthority;
......@@ -187,6 +187,7 @@ sub urn($) { return field($_[0], "urn"); }
sub url($) { return field($_[0], "url"); }
sub hrn($) { return field($_[0], "hrn"); }
sub type($) { return field($_[0], "type"); }
sub disabled($) { return field($_[0], "disabled"); }
sub cert($) { return $_[0]->{'CERT'}->cert(); }
sub GetCertificate($) { return $_[0]->{'CERT'}; }
......
......@@ -802,6 +802,8 @@ sub ListComponents($)
my $manager = GeniAuthority->Lookup($manager_uuid);
return GeniResponse->Create(GENIRESPONSE_DBERROR)
if (!defined($manager));
next
if ($manager->disabled());
push(@results, { "gid" => $manager->cert(),
"hrn" => $manager->hrn(),
......
......@@ -2763,14 +2763,13 @@ sub DeleteSlice($)
"Insufficient privilege" );
#
# See if we have a record of this slice in the DB. If not, then we have
# to go to the ClearingHouse to find its record, so that we can find out
# who the SA for it is.
# See if we have a record of this slice in the DB. Might have been
# expired out already.
#
my $slice = GeniSlice->Lookup($slice_uuid);
if (!defined($slice)) {
return GeniResponse->Create(GENIRESPONSE_BADARGS, undef,
"No such slice on this component: $slice_uuid");
return GeniResponse->Create(GENIRESPONSE_SEARCHFAILED, undef,
"No slice by that name");
}
if ($slice->Lock() != 0) {
return GeniResponse->BusyResponse();
......
......@@ -558,6 +558,7 @@ sub SliverAction($$$$)
(defined($slice_urn) || defined($sliver_urns)))) {
return GeniResponse->MalformedArgsResponse("Missing arguments");
}
my $credential = CheckCredentials($credentials);
return $credential
if (GeniResponse::IsResponse($credential));
......@@ -571,6 +572,21 @@ sub SliverAction($$$$)
# For now, only allow top level aggregate or the slice
#
my ($slice, $aggregate) = Credential2SliceAggregate($credential);
# find out the component manager URN.
my $cm_urn = GeniHRN::Generate($OURDOMAIN, "authority", "cm");
if ((!defined($slice)) && ($credential->target_urn() =~ "+authority+cm")) {
# administrative credentials are presented.
if ($cm_urn != $credential->target_urn() {
return GeniResponse->Create(GENIRESPONSE_FORBIDDEN(), undef,
"Credential target does not match CM URN");
}
if(!defined($slice_urn)){
return GeniResponse->MalformedArgsResponse("Missing arguments");
}
$slice = GeniSlice->Lookup($slice_urn);
}
if (! (defined($slice) && defined($aggregate))) {
return GeniResponse->Create(GENIRESPONSE_BADARGS, undef,
"No slice or aggregate here");
......
#!/usr/bin/perl -wT
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2009 University of Utah and the Flux Group.
# All rights reserved.
#
use strict;
use Exporter;
use vars qw(@ISA @EXPORT);
@ISA = "Exporter";
@EXPORT = qw ( );
use GeniCredential;
use GeniCertificate;
use GeniAuthority;
use GeniHRN;
use GeniResponse;
use GeniUser;
sub CreateAdminCredential()
{
my $owner_urn = shift;
my $target_cm_urn = shift;
#
# Must be an emulab user who is talking to us.
# If any of the URN specified is invalid do not accept.
if (! (GeniHRN::IsValid($owner_urn) && GeniHRN::IsValid($target_cm_urn))) {
return GeniResponse->MalformedArgsResponse();
}
my $geniuser = GeniUser->Lookup($owner_urn);
if (!defined($geniuser)) {
return GeniResponse->Create(GENIRESPONSE_FORBIDDEN,
undef, "Who are you?");
}
my $authority = GeniAuthority->Lookup($target_cm_urn);
if (!defined($authority)) {
print STDERR "Could not find local authority object for $target_cm_urn\n";
return GeniResponse->Create(GENIRESPONSE_ERROR);
}
my $credential =
GeniCredential->CreateSigned($authority,
$geniuser,
$GeniCredential::LOCALSA_FLAG);
return GeniResponse->Create(GENIRESPONSE_ERROR)
if (!defined($credential));
return GeniResponse->Create(GENIRESPONSE_SUCCESS,
$credential->asString());
}
print CreateAdminCredential @ARGV
#
# Add a disabled flag to authority, for ClearingHouse.
#
use strict;
use GeniDB;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
DBSetDefault($dbhandle);
if (!DBSlotExists("geni_authorities", "disabled")) {
DBQueryFatal("alter table geni_authorities ".
" add `disabled` tinyint(1) NOT NULL default '0' ".
" after `type`");
}
return 0;
}
1;
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004-2009 University of Utah and the Flux Group.
# Copyright (c) 2004-2010 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -190,7 +190,8 @@ sub RemoteDoVlansFromTables($@)
print STDERR "could not set vlan tag for $vlan\n";
$errors++;
}
VLan->RecordVlanInsertion($vlan->GetExperiment(), $vlan->lanid());
VLan->RecordVlanInsertion($vlan->GetExperiment(), $vlan->lanid(),
$vlan->GetClass());
}
}
else {
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -235,6 +235,15 @@ if (-f $SFSHOSTKEY) {
}
system("rm -f /var/sfs/sockets/*.sock");
# Clean out /var/tmp
print "Cleaning up /var/tmp ....\n";
system("rm -rf /var/tmp/*");
if (! -d "/var/tmp/vi.recover") {
print "Recreating /var/tmp/vi.recover ...\n";
system("mkdir /var/tmp/vi.recover");
system("chown root:wheel /var/tmp/vi.recover");
system("chmod 1777 /var/tmp/vi.recover");
}
print "Clearing out directories in $VARDIR ...\n";
foreach my $dir (@VARDIRS) {
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -130,7 +130,7 @@ sub os_account_cleanup()
my %PDB;
my %GDB;
my $gretval = dbmopen(%PDB, $PASSDB, undef);
my $pretval = dbmopen(%PDB, $PASSDB, undef);
my $gretval = dbmopen(%GDB, $GROUPDB, undef);
if ($pretval) {
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007, 2009 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -278,6 +278,10 @@ foreach my $dir (@SYSVARDIRS) {
}
}
# and clean out /var/tmp...hope there isn't anything we should be leaving!
print "Cleaning up /var/tmp ....\n";
system("rm -rf /var/tmp/*");
# take these out since they are large and RHL regens them anyway
system("rm -f /var/lib/rpm/__db*");
......
......@@ -59,7 +59,7 @@ tweakmbr()
size=`echo -e 'u\np\nq' | fdisk $disk 2> /dev/null| \
sed -n "s#^${disk}1 *. *[0-9]* *[0-9]* *\([0-9]*\).*\\$#\1#p"`
size=`expr $size '*' 2`
[ -n "$size" ] && size=`expr $size '*' 2`
case ${size}s in
6281352s)
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004, 2005 University of Utah and the Flux Group.
# Copyright (c) 2004-2010 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -42,11 +42,12 @@ if ($UID) {
#
my $TB = "@prefix@";
my $TBOPS = "@TBOPSEMAIL@";
my $INPUTLOG = "/usr/testbed/scratch/CVS/CVSROOT/commitlogs/testbed";
my $GIT = "/usr/local/bin/git";
my $GITDIR = "/z/GIT/emulab-devel.git";
my $OUTPUTLOG = "$TB/www/doc/ChangeLog.txt";
my $MONTHROOT = "$TB/www/doc/ChangeLog";
my $HTMLFILE = "$TB/www/doc/changelog-months.html";
my $STARTDATE = "2003/10";
my $STARTDATE = "2003-10";
my $tempname = "/tmp/import.$$";
my @entries = ();
......@@ -79,8 +80,9 @@ if (defined($options{d})) {
$debug = 1;
}
if (!open(INPUT, $INPUTLOG)) {
fatal("Could not open $INPUTLOG for reading!");
if (!open(INPUT, "$GIT --git-dir=$GITDIR log ".
"--pretty=medium --numstat --date=iso --reverse |")) {
fatal("Could not start $GIT log process!");
}
if (!open(OUTPUT, "> $tempname")) {
fatal("Could not open $tempname for writing!");
......@@ -90,12 +92,18 @@ if (!open(OUTPUT, "> $tempname")) {
# Skip to approximate start date.
#
while (<INPUT>) {
if ($_ =~ /^\w*\s*(\d\d\d\d\/\d\d)\/\d\d\s*\d\d:\d\d:\d\d\s*\w\w\w$/) {
if ($_ =~
/^Date:\s*(\d\d\d\d\-\d\d)\-\d\d\s*\d\d:\d\d:\d\d\s*[+-]?\w\w\w\w$/) {
if ($1 eq $STARTDATE) {
last;
}
}
}
while (<INPUT>) {
if ($_ =~ /^commit\s*[\w]*$/) {
last;
}
}
my $entry = $_;
#
......@@ -105,13 +113,18 @@ my $this_month = $STARTDATE;
my $index = 0;
my @month_index = ($STARTDATE);
my %month_data = ($STARTDATE => []);
my $month;
while (<INPUT>) {
if ($_ =~ /^\w*\s*(\d\d\d\d\/\d\d)\/\d\d\s*\d\d:\d\d:\d\d\s*\w\w\w$/) {
if ($_ =~
/^Date:\s*(\d\d\d\d\-\d\d)\-\d\d\s*\d\d:\d\d:\d\d\s*[+-]?\w\w\w\w$/) {
$month = $1;
}
elsif ($_ =~ /^commit\s*[\w]*$/) {
unshift(@{ $month_data{$this_month} }, $entry);
$entry = $_;
if ($1 ne $this_month) {
$this_month = $1;
if ($month ne $this_month) {
$this_month = $month;
$index++;
$month_index[$index] = $this_month;
$month_data{$this_month} = [];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment