diff --git a/obfssh_scp/scp.go b/obfssh_scp/scp.go index 62cf0a8..24f15be 100644 --- a/obfssh_scp/scp.go +++ b/obfssh_scp/scp.go @@ -259,6 +259,8 @@ func download(args []string, cfg *options) error { lfile = filepath.Join(lfile, filepath.Base(path)) } + lfile = clean(lfile) + if err := get(sftpConn, path, lfile); err != nil { debuglog("download error: %s", err) err1 = err @@ -345,6 +347,8 @@ func upload(args []string, cfg *options) error { remoteFile = filepath.Join(path, filepath.Base(localFile)) } + remoteFile = clean(remoteFile) + if err := put(sftpConn, localFile, remoteFile); err != nil { debuglog("upload %s failed: %s", localFile, err.Error()) err1 = err