Commit 12c8e5e4 authored by Leigh Stoller's avatar Leigh Stoller

Minot bug fixes to shadow mode.

parent 513386fd
......@@ -161,11 +161,28 @@ BEGIN
if (exists($ENV{'SHADOW'})) {
$shadow = $ENV{'SHADOW'};
my ($server,$urn) = split(',', $shadow);
#
# Need to taint check these to avoid breakage later.
#
if ($server =~ /^([-\w\.]+)$/) {
$server = $1;
}
else {
die("Bad data in server: $server");
}
if ($urn =~ /^([-\w\+\:\.]*)$/) {
$urn = $1;
}
else {
die("Bad data in urn: $urn");
}
# The cache needs to go in a difference location.
libtmcc::configtmcc("cachedir", $SHADOWDIR);
libtmcc::configtmcc("server", $server);
libtmcc::configtmcc("urn", $urn);
# No proxy.
libtmcc::configtmcc("noproxy", 1);
}
#
# Determine if running inside a jail. This affects the paths below.
......
......@@ -39,6 +39,7 @@ use Exporter;
# Must come after package declaration!
use English;
use Data::Dumper;
#
# Turn off line buffering on output
......@@ -498,6 +499,9 @@ sub tmccbossname()
{
my @tmccresults;
return $ENV{'BOSSNAME'}
if (exists($ENV{'BOSSNAME'}));
if (runtmcc(TMCCCMD_BOSSINFO, undef, \@tmccresults) < 0 ||
!scalar(@tmccresults)) {
warn("*** WARNING: Could not get bossinfo from tmcc!\n");
......
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