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