From 11de1376601c461379dd5ec05ee55f92e334b1d2 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 18 Aug 2023 11:37:32 +0100 Subject: [PATCH] sftp: fix spurious warning when using --sftp-ssh When using --sftp-ssh we were warning about user/host/port even when they were at their defaults. See: #7235 --- backend/sftp/sftp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/sftp/sftp.go b/backend/sftp/sftp.go index 5feb863d6..8c66fbb7e 100644 --- a/backend/sftp/sftp.go +++ b/backend/sftp/sftp.go @@ -780,7 +780,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e if err != nil { return nil, err } - if len(opt.SSH) != 0 && (opt.User != "" || opt.Host != "" || opt.Port != "") { + if len(opt.SSH) != 0 && ((opt.User != currentUser && opt.User != "") || opt.Host != "" || (opt.Port != "22" && opt.Port != "")) { fs.Logf(name, "--sftp-ssh is in use - ignoring user/host/port from config - set in the parameters to --sftp-ssh (remove them from the config to silence this warning)") }