Fixed abs/relative path for client dest copies

This commit is contained in:
Russ Magee 2018-08-30 20:16:55 -07:00
parent 143990da34
commit c3572d7c0c
1 changed files with 4 additions and 1 deletions

View File

@ -141,7 +141,10 @@ func runServerToClientCopyAs(who string, conn hkexnet.Conn, srcPath string, chaf
var c *exec.Cmd var c *exec.Cmd
cmdName := "/bin/tar" cmdName := "/bin/tar"
//cmdArgs := []string{"-c", "-f", "-", srcPath} if !path.IsAbs(srcPath) {
srcPath = fmt.Sprintf("%s%c%s", u.HomeDir, os.PathSeparator, srcPath)
}
srcDir, srcBase := path.Split(srcPath) srcDir, srcBase := path.Split(srcPath)
cmdArgs := []string{"-cz", "-C", srcDir, "-f", "-", srcBase} cmdArgs := []string{"-cz", "-C", srcDir, "-f", "-", srcBase}