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
This commit is contained in:
Nick Craig-Wood 2023-08-18 11:37:32 +01:00
parent 156c372cd7
commit 11de137660

View file

@ -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)")
}