From cf4239dd9fffcbb16db9072ceb2345161fc90cad Mon Sep 17 00:00:00 2001 From: fangdingjun Date: Tue, 20 Dec 2016 17:49:14 +0800 Subject: [PATCH] unified the file path --- obfssh_scp/scp.go | 4 ++++ 1 file changed, 4 insertions(+) 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