Skip to content

Commit 32f4a0e

Browse files
committed
1 parent ead99b9 commit 32f4a0e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sftpserver/sftpserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (s *SFTPServer) Start() error {
8282
sshServer.HostSigners = []ssh.Signer{private}
8383
}
8484

85-
if s.Username != "" && s.Password != "" {
85+
if s.Username != "" || s.Password != "" {
8686
sshServer.PasswordHandler = func(ctx ssh.Context, password string) bool {
8787
return subtle.ConstantTimeCompare([]byte(ctx.User()), []byte(s.Username)) == 1 && subtle.ConstantTimeCompare([]byte(password), []byte(s.Password)) == 1
8888
}

0 commit comments

Comments
 (0)