Commit 0bd58582 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Wrap all calls to XMLin/XMLout in eval() to avoid premature exit.

parent 3efb0d8e
...@@ -360,9 +360,15 @@ sub GetTicket($;$) ...@@ -360,9 +360,15 @@ sub GetTicket($;$)
return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, return GeniResponse->Create(GENIRESPONSE_BADARGS, undef,
"Improper rspec"); "Improper rspec");
} }
$rspec = XMLin($rspec, KeyAttr => [], $rspec =
ForceArray => ["node", "link", "interface", eval { XMLin($rspec, KeyAttr => [],
"interface_ref", "linkendpoints"]); ForceArray => ["node", "link", "interface",
"interface_ref", "linkendpoints"]) };
if ($@) {
print STDERR "XMLin error: $@\n";
return GeniResponse->Create(GENIRESPONSE_BADARGS, undef,
"XML error in rspec");
}
} }
else { else {
return GeniResponse->MalformedArgsResponse(); return GeniResponse->MalformedArgsResponse();
...@@ -1065,9 +1071,17 @@ sub GetTicket($;$) ...@@ -1065,9 +1071,17 @@ sub GetTicket($;$)
} }
goto bad; goto bad;
} }
my $solution = XMLin($tmpfile, KeyAttr => [], my $solution =
ForceArray => ["node", "link", "interface", eval { XMLin($tmpfile, KeyAttr => [],
"interface_ref", "linkendpoints"]); ForceArray => ["node", "link", "interface",
"interface_ref", "linkendpoints"]) };
if ($@) {
print STDERR "XMLin error: $@\n";
$response = GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"XML error in solution");
goto bad;
}
unlink($tmpfile); unlink($tmpfile);
print Dumper($solution); print Dumper($solution);
...@@ -2047,8 +2061,12 @@ sub SliverWork($$) ...@@ -2047,8 +2061,12 @@ sub SliverWork($$)
} }
# The Manifest. # The Manifest.
my $manifest = XMLout($rspec, "NoAttr" => 1); my $manifest =
$manifest =~ s/opt\>/rspec\>/g; eval { XMLout($rspec, "NoAttr" => 1, RootName => "manifest") };
if ($@) {
print STDERR "Manifest: XMLout error: $@\n";
print STDERR Dumper($rspec);
}
# #
# Move this elsewhere. # Move this elsewhere.
...@@ -2236,9 +2254,15 @@ sub StartSliver($) ...@@ -2236,9 +2254,15 @@ sub StartSliver($)
} }
if (defined($manifest)) { if (defined($manifest)) {
$manifest = XMLin($manifest, KeyAttr => [], $manifest =
ForceArray => ["node", "link", "interface", eval { XMLin($manifest, KeyAttr => [],
"interface_ref", "linkendpoints"]); ForceArray => ["node", "link", "interface",
"interface_ref", "linkendpoints"]) };
if ($@) {
print STDERR "XMLin error reading manifest: $@\n";
return GeniResponse->Create(GENIRESPONSE_BADARGS, undef,
"Bad manifest");
}
} }
# #
......
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