SSHD: Create user instance only once during authentication
Change-Id: I91c26d1ac9211c6cdb6bf391ace1416d290d343b
This commit is contained in:
parent
a145270984
commit
7953027df2
@ -140,14 +140,13 @@ class DatabasePubKeyAuth implements PublickeyAuthenticator {
|
||||
}
|
||||
}
|
||||
|
||||
if (!SshUtil.createUser(sd, userFactory, key.getAccount())
|
||||
.getAccount().isActive()) {
|
||||
IdentifiedUser cu = SshUtil.createUser(sd, userFactory, key.getAccount());
|
||||
if (!cu.getAccount().isActive()) {
|
||||
sd.authenticationError(username, "inactive-account");
|
||||
return false;
|
||||
}
|
||||
|
||||
return SshUtil.success(username, session, sshScope, sshLog, sd,
|
||||
SshUtil.createUser(sd, userFactory, key.getAccount()));
|
||||
return SshUtil.success(username, session, sshScope, sshLog, sd, cu);
|
||||
}
|
||||
|
||||
private Set<PublicKey> getPeerKeys() {
|
||||
|
Loading…
Reference in New Issue
Block a user