Commit abcbe37c authored by Leigh B Stoller's avatar Leigh B Stoller

Better sanity checking on ssh keys.

parent 6d7bbb83
......@@ -333,8 +333,11 @@ sub Create($$$$;$)
}
# Insert the sshkey if we got one.
if (defined($keys)) {
if (defined($keys) && ref($keys)) {
foreach my $keyref (@{ $keys }) {
next
if (!ref($keyref));
my $key = $keyref->{'key'};
my $type = $keyref->{'type'};
......@@ -385,11 +388,14 @@ sub Modify($$$$)
"where idx='$idx'"));
}
if (defined($keys)) {
if (defined($keys) && ref($keys)) {
return -1
if (!DBQueryWarn("delete from geni_userkeys where uuid='$uuid'"));
foreach my $keyref (@{ $keys }) {
next
if (!ref($keyref));
my $key = $keyref->{'key'};
my $type = $keyref->{'type'};
......
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