Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
1263cc28
Commit
1263cc28
authored
Jun 11, 2009
by
Leigh B. Stoller
Browse files
Hmm, a left over protogeni change; method to change ssh keys.
parent
a727dac1
Changes
1
Hide whitespace changes
Inline
Side-by-side
db/User.pm.in
View file @
1263cc28
...
...
@@ -1707,6 +1707,35 @@ sub Create($$$$$$;$)
return User::NonLocal->Lookup($idx);
}
#
# Modify the keys.
#
sub ModifyKeys($$)
{
my ($self, $sshkeys) = @_;
return 0
if ($self->shadow());
my $idx = $self->uid_idx();
my $uid = $self->uid();
DBQueryWarn("delete from user_pubkeys where uid_idx='
$
idx
'")
or return -1;
if (defined($sshkeys)) {
foreach my $sshkey (@{ $sshkeys }) {
my $safe_sshkey = DBQuoteSpecial($sshkey);
DBQueryWarn("insert into user_pubkeys set ".
" uid='
$
uid
', uid_idx='
$
idx
', ".
" idx=NULL, stamp=now(), pubkey=$safe_sshkey")
or return -1;
}
}
return 0;
}
#
# Delete the user, as for registration errors.
#
...
...
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