Commit 08dc36ae authored by Leigh B Stoller's avatar Leigh B Stoller

Changes to full cooked mode. Works nicely now.

parent 435dba8b
......@@ -16,8 +16,8 @@ use vars qw(@ISA @EXPORT);
# Configure variables
my $TB = "@prefix@";
my $BOSSNODE = "@BOSSNODE@";
#my $TBDOCBASE = "@TBDOCBASE@";
my $TBDOCBASE = "http://www.emulab.net";
my $TBDOCBASE = "@TBDOCBASE@";
#my $TBDOCBASE = "http://www.emulab.net";
my $ELVIN_COMPAT= @ELVIN_COMPAT@;
my $ASSIGN = "$TB/libexec/assign";
......@@ -508,7 +508,7 @@ sub GetTickets($)
"$TBDOCBASE/downloads/geniclient.tar");
my $cmd = "sudo /usr/local/etc/emulab/rc/rc.pgeni ".
"-s $BOSSNODE -k $eventkey,$keyhash -r '$key'";
"-s $BOSSNODE -k $eventkey,$keyhash -i '$key'";
$cmd .= " -j " . $node->node_id()
if ($node->isvirtnode());
$cmd .= " -e 16509"
......
......@@ -167,14 +167,14 @@ sub dotopomap()
}
}
my $optarg = (defined($vnodeid) ? "-n $vnodeid" : "");
my $urnarg = (exists($ENV{'URN'}) ? "URN=" . $ENV{'URN'} : "");
my $idarg = (exists($ENV{'IDKEY'}) ? "IDKEY=" . $ENV{'IDKEY'} : "");
if (! -e $tempmap) {
#
# Try using tmcc. It returns compressed data so do it directly.
# XXX note that tmcc does not return a meaningful exit value.
#
system(TMCCBIN() . " $optarg $urnarg topomap > $tempmap");
system(TMCCBIN() . " $optarg $idarg topomap > $tempmap");
}
if (! -e $templt) {
......@@ -182,7 +182,7 @@ sub dotopomap()
# Try using tmcc. It returns compressed data so do it directly.
# XXX note that tmcc does not return a meaningful exit value.
#
system(TMCCBIN() . " $optarg $urnarg ltmap > $templt");
system(TMCCBIN() . " $optarg $idarg ltmap > $templt");
}
if (! -e $templtp) {
......@@ -190,7 +190,7 @@ sub dotopomap()
# Try using tmcc. It returns compressed data so do it directly.
# XXX note that tmcc does not return a meaningful exit value.
#
system(TMCCBIN() . " $optarg $urnarg ltpmap > $templtp");
system(TMCCBIN() . " $optarg $idarg ltpmap > $templtp");
}
if (-s $tempmap) {
......
......@@ -169,7 +169,7 @@ BEGIN
#
if (exists($ENV{'SHADOW'})) {
$shadow = $ENV{'SHADOW'};
my ($server,$urn) = split(',', $shadow);
my ($server,$idkey) = split(',', $shadow);
#
# Need to taint check these to avoid breakage later.
#
......@@ -179,17 +179,17 @@ BEGIN
else {
die("Bad data in server: $server");
}
if ($urn =~ /^([-\w\+\:\.]*)$/) {
$urn = $1;
if ($idkey =~ /^([-\w\+\:\.]*)$/) {
$idkey = $1;
}
else {
die("Bad data in urn: $urn");
die("Bad data in urn: $idkey");
}
# The cache needs to go in a difference location.
libtmcc::configtmcc("cachedir", $SHADOWDIR);
libtmcc::configtmcc("server", $server);
libtmcc::configtmcc("urn", $urn);
libtmcc::configtmcc("idkey", $idkey);
# No proxy.
libtmcc::configtmcc("noproxy", 1);
}
......@@ -2094,21 +2094,21 @@ sub bootsetup()
#
sub shadowsetup($$)
{
my ($server, $urn) = @_;
my ($server, $idkey) = @_;
$shadow = 1;
# This changes where tmcc is going to store the data.
libtmcc::configtmcc("cachedir", $SHADOWDIR);
libtmcc::configtmcc("server", $server);
libtmcc::configtmcc("urn", $urn);
libtmcc::configtmcc("idkey", $idkey);
# No proxy.
libtmcc::configtmcc("noproxy", 1);
# Tell children.
$ENV{'SHADOW'} = "$server,$urn";
$ENV{'URN'} = $urn;
$ENV{'SHADOW'} = "$server,$idkey";
$ENV{'IDKEY'} = $idkey;
# Tell libtmcc to forget anything it knows.
tmccclrconfig();
......
......@@ -87,7 +87,7 @@ my $beproxy = 0;
"noproxy" => 0,
"nossl" => 0,
"cachedir" => undef,
"urn" => undef,
"idkey" => undef,
"usetpm" => 0,
);
......@@ -368,8 +368,8 @@ sub runtmcc ($;$$%)
if (%optconfig);
# Must be last option, before command
if (defined($config{"urn"})) {
$options .= " URN=" . $config{"urn"};
if (defined($config{"idkey"})) {
$options .= " IDKEY=" . $config{"idkey"};
}
if (!defined($args)) {
......
......@@ -15,17 +15,17 @@ use Getopt::Std;
sub usage()
{
print "Usage: " . scriptname() .
" -s server -u urn [-j vnodeid] boot|shutdown|reconfig|reset\n";
" -s server -i key [-j vnodeid] boot|shutdown|reconfig|reset\n";
exit(1);
}
my $optlist = "s:j:u:k:e:";
my $optlist = "s:j:u:k:e:i:";
my $vnodeid;
my $server;
my $action;
my $idkey;
my $eventkey;
my $keyhash;
my $v0_compat;
my $urn;
# Turn off line buffering on output
$| = 1;
......@@ -71,8 +71,8 @@ if (defined($options{'s'})) {
if (defined($options{'k'})) {
($eventkey,$keyhash) = split(',', $options{'k'});
}
if (defined($options{'u'})) {
$urn = $options{'u'};
if (defined($options{'i'})) {
$idkey = $options{'i'};
}
if (defined($options{'e'})) {
$v0_compat = $options{'e'};
......@@ -86,7 +86,7 @@ if (@ARGV) {
$action = $ARGV[0];
}
usage()
if (! (defined($server) && defined($urn) && defined($action)));
if (! (defined($server) && defined($idkey) && defined($action)));
# For tmcc client.
$ENV{'BOSSNAME'} = $server;
......@@ -177,7 +177,7 @@ sub BootFatal($$)
sub doboot()
{
print("Checking Testbed reservation status on $server\n");
my ($pid, $eid, $vname) = libsetup::shadowsetup($server, $urn);
my ($pid, $eid, $vname) = libsetup::shadowsetup($server, $idkey);
if (!defined($pid)) {
print "Node is free\n";
......
......@@ -1078,11 +1078,11 @@ handle_request(int sock, struct sockaddr_in *client, char *rdata, int istcp)
/*
* Look for external key
*/
if (sscanf(bp, "KEY=%" XSTRINGIFY(PRIVKEY_LEN) "s", buf)) {
if (sscanf(bp, "IDKEY=%" XSTRINGIFY(PRIVKEY_LEN) "s", buf)) {
for (i = 0; i < strlen(buf); i++){
if (! isalnum(buf[i])) {
info("tmcd client provided invalid "
"characters in KEY");
"characters in IDKEY");
goto skipit;
}
}
......@@ -1090,7 +1090,7 @@ handle_request(int sock, struct sockaddr_in *client, char *rdata, int istcp)
buf, sizeof(reqp->external_key));
if (debug) {
info("KEY %s\n", buf);
info("IDKEY %s\n", buf);
}
continue;
}
......
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