Commit fd86599f authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Add ValidUUID() predicate.

parent f814f9df
#!/usr/bin/perl -w
#
# Copyright (c) 2000-2016 University of Utah and the Flux Group.
# Copyright (c) 2000-2017 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -34,7 +34,7 @@ use vars qw(@ISA @EXPORT);
TBGetUniqueIndex ParRun VersionInfo UpdateVersionInfo
SpanningTree GenFakeMac BackTraceOnWarning PassWordHash
SSHwithTimeout TBDateStringGMT TBDateStringLocal runBusyLoop
MapEventType MapEventObjectType MapEventTriggerType
MapEventType MapEventObjectType MapEventTriggerType ValidUUID
);
use emdb;
......@@ -992,5 +992,14 @@ sub MapEventTriggerType($)
return $idx;
}
sub ValidUUID($)
{
my ($uuid) = @_;
if ($uuid =~ /^\w+\-\w+\-\w+\-\w+\-\w+$/) {
return 1;
}
return 0;
}
# _Always_ make sure that this 1 is at the end of the file...
1;
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