Commit d2287fb4 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Minor (but temporary) fix for updating ssh keys. Once the user was

created, the keys were never updated.

This fix is temporary, a better fix next week.
parent 6c13f2b2
...@@ -26,6 +26,7 @@ use vars qw(); ...@@ -26,6 +26,7 @@ use vars qw();
BEGIN { BEGIN {
if (! defined($main::GENI_ISCLRHOUSE)) { if (! defined($main::GENI_ISCLRHOUSE)) {
require User; require User;
require emdb;
} }
} }
...@@ -447,6 +448,32 @@ sub BindToSlice($$) ...@@ -447,6 +448,32 @@ sub BindToSlice($$)
return -1; return -1;
} }
} }
else {
my @sshkeys = ();
$self->GetSSHKeys(\@sshkeys);
if (0) {
$emulab_user->ModifyKeys(\@sshkeys);
}
elsif (!$emulab_user->shadow()) {
my $idx = $emulab_user->idx();
my $uid = $emulab_user->uid();
emdb::DBQueryWarn("delete from user_pubkeys where uid_idx='$idx'")
or return -1;
if (@sshkeys) {
foreach my $sshkey (@sshkeys) {
my $safe_sshkey = DBQuoteSpecial($sshkey);
emdb::DBQueryWarn("insert into user_pubkeys set ".
" uid='$uid', uid_idx='$idx', ".
" idx=NULL, stamp=now(), ".
"pubkey=$safe_sshkey")
or return -1;
}
}
}
}
my $experiment = $slice->GetExperiment(); my $experiment = $slice->GetExperiment();
if (!defined($experiment)) { if (!defined($experiment)) {
print STDERR "Could not locate experiment object for $slice\n"; print STDERR "Could not locate experiment object for $slice\n";
......
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