Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
08dc36ae
Commit
08dc36ae
authored
Dec 07, 2010
by
Leigh B Stoller
Browse files
Changes to full cooked mode. Works nicely now.
parent
435dba8b
Changes
6
Hide whitespace changes
Inline
Side-by-side
db/libGeni.pm.in
View file @
08dc36ae
...
...
@@ -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"
...
...
tmcd/common/config/rc.topomap
View file @
08dc36ae
...
...
@@ -167,14 +167,14 @@ sub dotopomap()
}
}
my
$optarg
=
(
defined
(
$vnodeid
)
?
"
-n
$vnodeid
"
:
"");
my
$
urn
arg
=
(
exists
(
$ENV
{'
URN
'})
?
"
URN
=
"
.
$ENV
{'
URN
'}
:
"");
my
$
id
arg
=
(
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
$
urn
arg
topomap >
$tempmap
");
system
(
TMCCBIN
()
.
"
$optarg
$
id
arg
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
$
urn
arg
ltmap >
$templt
");
system
(
TMCCBIN
()
.
"
$optarg
$
id
arg
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
$
urn
arg
ltpmap >
$templtp
");
system
(
TMCCBIN
()
.
"
$optarg
$
id
arg
ltpmap >
$templtp
");
}
if
(
-
s $tempmap) {
...
...
tmcd/common/libsetup.pm
View file @
08dc36ae
...
...
@@ -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
();
...
...
tmcd/common/libtmcc.pm
View file @
08dc36ae
...
...
@@ -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
))
{
...
...
tmcd/common/rc.pgeni
View file @
08dc36ae
...
...
@@ -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
"
;
...
...
tmcd/tmcd.c
View file @
08dc36ae
...
...
@@ -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
,
"
ID
KEY=%"
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
ID
KEY"
);
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
(
"
ID
KEY %s
\n
"
,
buf
);
}
continue
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment