protect args

This commit is contained in:
Celogeek 2023-08-22 08:40:02 +02:00
parent f4d4f3075e
commit 2c197e2208
Signed by: celogeek
SSH Key Fingerprint: SHA256:DEDfxIK2nUWXbslbRkww3zsauDjhWHlTXar+ak4lDJ4

View File

@ -4,6 +4,7 @@ import (
"bufio"
"bytes"
"fmt"
"os"
"os/exec"
"regexp"
"strconv"
@ -69,6 +70,7 @@ func (r *Rsync) Run() error {
"--inplace",
"--no-inc-recursive",
"--info=progress2",
"-s",
}
if r.Rsh != "" {
args = append(args, "--rsh", r.Rsh)
@ -78,6 +80,7 @@ func (r *Rsync) Run() error {
"rsync",
args...,
)
cmd.Stderr = os.Stderr
out, err := cmd.StdoutPipe()
if err != nil {
return err