Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
0bd58582
Commit
0bd58582
authored
Oct 21, 2009
by
Leigh B. Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap all calls to XMLin/XMLout in eval() to avoid premature exit.
parent
3efb0d8e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
11 deletions
+35
-11
protogeni/lib/GeniCM.pm.in
protogeni/lib/GeniCM.pm.in
+35
-11
No files found.
protogeni/lib/GeniCM.pm.in
View file @
0bd58582
...
...
@@ -360,9 +360,15 @@ sub GetTicket($;$)
return
GeniResponse
->
Create
(
GENIRESPONSE_BADARGS
,
undef
,
"Improper rspec"
);
}
$
rspec
=
XMLin
($
rspec
,
KeyAttr
=>
[],
$
rspec
=
eval
{
XMLin
($
rspec
,
KeyAttr
=>
[],
ForceArray
=>
[
"node"
,
"link"
,
"interface"
,
"interface_ref"
,
"linkendpoints"
]);
"interface_ref"
,
"linkendpoints"
])
};
if
($@)
{
print
STDERR
"XMLin error: $@
\n
"
;
return
GeniResponse
->
Create
(
GENIRESPONSE_BADARGS
,
undef
,
"XML error in rspec"
);
}
}
else
{
return
GeniResponse
->
MalformedArgsResponse
();
...
...
@@ -1065,9 +1071,17 @@ sub GetTicket($;$)
}
goto
bad
;
}
my
$
solution
=
XMLin
($
tmpfile
,
KeyAttr
=>
[],
my
$
solution
=
eval
{
XMLin
($
tmpfile
,
KeyAttr
=>
[],
ForceArray
=>
[
"node"
,
"link"
,
"interface"
,
"interface_ref"
,
"linkendpoints"
]);
"interface_ref"
,
"linkendpoints"
])
};
if
($@)
{
print
STDERR
"XMLin error: $@
\n
"
;
$
response
=
GeniResponse
->
Create
(
GENIRESPONSE_ERROR
,
undef
,
"XML error in solution"
);
goto
bad
;
}
unlink
($
tmpfile
);
print
Dumper
($
solution
);
...
...
@@ -2047,8 +2061,12 @@ sub SliverWork($$)
}
#
The
Manifest
.
my
$
manifest
=
XMLout
($
rspec
,
"NoAttr"
=>
1
);
$
manifest
=~
s
/
opt
\>/
rspec
\>/
g
;
my
$
manifest
=
eval
{
XMLout
($
rspec
,
"NoAttr"
=>
1
,
RootName
=>
"manifest"
)
};
if
($@)
{
print
STDERR
"Manifest: XMLout error: $@
\n
"
;
print
STDERR
Dumper
($
rspec
);
}
#
#
Move
this
elsewhere
.
...
...
@@ -2236,9 +2254,15 @@ sub StartSliver($)
}
if
(
defined
($
manifest
))
{
$
manifest
=
XMLin
($
manifest
,
KeyAttr
=>
[],
$
manifest
=
eval
{
XMLin
($
manifest
,
KeyAttr
=>
[],
ForceArray
=>
[
"node"
,
"link"
,
"interface"
,
"interface_ref"
,
"linkendpoints"
]);
"interface_ref"
,
"linkendpoints"
])
};
if
($@)
{
print
STDERR
"XMLin error reading manifest: $@
\n
"
;
return
GeniResponse
->
Create
(
GENIRESPONSE_BADARGS
,
undef
,
"Bad manifest"
);
}
}
#
...
...
Write
Preview
Markdown
is supported
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