From ce83228cb21e6839c105b55d71c50cab671e4ed6 Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Tue, 11 May 2021 19:58:26 +0200 Subject: [PATCH] sftp: expand tilde and environment variables in configured known_hosts_file (#5322) Fixes #5220 --- 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 e9f5a490a..ea003cda5 100644 --- a/backend/sftp/sftp.go +++ b/backend/sftp/sftp.go @@ -566,7 +566,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e } if opt.KnownHostsFile != "" { - hostcallback, err := knownhosts.New(opt.KnownHostsFile) + hostcallback, err := knownhosts.New(env.ShellExpand(opt.KnownHostsFile)) if err != nil { return nil, errors.Wrap(err, "couldn't parse known_hosts_file") }