Commit 1c8830e1 authored by Leigh B Stoller's avatar Leigh B Stoller

Check slice names to ensure they are legal Emulab experiment names.

parent b8d79ac6
......@@ -355,6 +355,8 @@ sub Resolve($)
#
sub Register($)
{
require Experiment;
# FIXME once migration to URNs is complete, $type should be removed
# (it's deduced automatically from the URN).
my ($argref) = @_;
......@@ -435,6 +437,11 @@ sub Register($)
if ( lc( $type ) eq "slice") {
my $expires = $argref->{'expiration'};
if (! Experiment->ValidEID($hrn)) {
return GeniResponse->Create(GENIRESPONSE_BADARGS, undef,
"$hrn is not a valid slice name");
}
#
# Figure out new expiration time; this is the time at which we can
# idleswap the slice out.
......
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