aboutsummaryrefslogtreecommitdiff
path: root/lib/ssh
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-09-27 10:17:16 +0700
committerShulhan <ms@kilabit.info>2023-09-27 10:17:16 +0700
commitfa2510a8d458dc6d66d7df6e6ac94365553c248a (patch)
treeebbf68c34b611e774eb00841a66526c933359107 /lib/ssh
parent8d0720f6f9406262868e2efa0d757ec27ef7119d (diff)
downloadpakakeh.go-fa2510a8d458dc6d66d7df6e6ac94365553c248a.tar.xz
lib/ssh: fix missing error check from previous changes 8d0720f6
Diffstat (limited to 'lib/ssh')
-rw-r--r--lib/ssh/client.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ssh/client.go b/lib/ssh/client.go
index 0f1ed680..420170c1 100644
--- a/lib/ssh/client.go
+++ b/lib/ssh/client.go
@@ -111,7 +111,7 @@ func NewClientInteractive(section *config.Section) (cl *Client, err error) {
return cl, nil
}
- if strings.Contains(err.Error(), `knownhosts`) {
+ if err != nil && strings.Contains(err.Error(), `knownhosts`) {
// Host key is either unknown or mismatch with one
// of known_hosts files, so no need to continue with
// dialWithPrivateKeys.