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

Minor bug fixes to hrn regex.

parent b6ac7dbb
...@@ -330,7 +330,8 @@ sub CreateFromSigned($$;$) ...@@ -330,7 +330,8 @@ sub CreateFromSigned($$;$)
return undef; return undef;
} }
if (!($target_certificate->hrn() =~ /^[-\w\.]+$/)) { if (!($target_certificate->hrn() =~ /^[-\w\.]+$/)) {
print STDERR "Invalid hrn in credential\n"; my $hrn = $target_certificate->hrn();
print STDERR "Invalid hrn $hrn in target of credential\n";
return undef; return undef;
} }
if (!GeniHRN::IsValid($target_certificate->urn())) { if (!GeniHRN::IsValid($target_certificate->urn())) {
...@@ -353,7 +354,8 @@ sub CreateFromSigned($$;$) ...@@ -353,7 +354,8 @@ sub CreateFromSigned($$;$)
return undef; return undef;
} }
if (!($owner_certificate->hrn() =~ /^[-\w\.]+$/)) { if (!($owner_certificate->hrn() =~ /^[-\w\.]+$/)) {
print STDERR "Invalid hrn in credential\n"; my $hrn = $owner_certificate->hrn();
print STDERR "Invalid hrn $hrn in owner of credential\n";
return undef; return undef;
} }
if (!GeniHRN::IsValid($owner_certificate->urn())) { if (!GeniHRN::IsValid($owner_certificate->urn())) {
......
...@@ -337,8 +337,9 @@ sub CreateFromSignedTicket($$;$$) ...@@ -337,8 +337,9 @@ sub CreateFromSignedTicket($$;$$)
print STDERR "Invalid target_uuid in credential\n"; print STDERR "Invalid target_uuid in credential\n";
return undef; return undef;
} }
if (!($target_certificate->hrn() =~ /^[\w\.]+$/)) { if (!($target_certificate->hrn() =~ /^[-\w\.]+$/)) {
print STDERR "Invalid hrn in credential\n"; my $hrn = $target_certificate->hrn();
print STDERR "Invalid hrn $hrn in target of ticket\n";
return undef; return undef;
} }
...@@ -358,8 +359,9 @@ sub CreateFromSignedTicket($$;$$) ...@@ -358,8 +359,9 @@ sub CreateFromSignedTicket($$;$$)
print STDERR "Invalid target_uuid in credential\n"; print STDERR "Invalid target_uuid in credential\n";
return undef; return undef;
} }
if (!($owner_certificate->hrn() =~ /^[\w\.]+$/)) { if (!($owner_certificate->hrn() =~ /^[-\w\.]+$/)) {
print STDERR "Invalid hrn in credential\n"; my $hrn = $owner_certificate->hrn();
print STDERR "Invalid hrn $hrn in owner of ticket\n";
return undef; return undef;
} }
......
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