fix empty password bug

This commit is contained in:
Boshi Lian 2022-07-18 22:27:34 +00:00
parent 56844d0295
commit 4d2f795701
2 changed files with 2 additions and 2 deletions

View file

@ -150,7 +150,7 @@ func (p *plugin) findAndCreateUpstream(conn libplugin.ConnMetadata, password str
for _, pipe := range pipes {
// test password
if publicKey == nil {
if publicKey == nil && password != "" {
if pipe.ClientUsername != user {
continue
}

View file

@ -252,7 +252,7 @@ func (p *plugin) findAndCreateUpstream(conn libplugin.ConnMetadata, password str
continue
}
if publicKey == nil {
if publicKey == nil && password != "" {
return p.createUpstream(conn, pipe.To, password)
}