1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

sftp: expand tilde and environment variables in configured known_hosts_file (#5322)

Fixes #5220
This commit is contained in:
albertony
2021-05-11 19:58:26 +02:00
committed by GitHub
parent 732bc08ced
commit ce83228cb2

View File

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