From 5a018ac66abf72bbe611b0c1620af3ae8b1ad731 Mon Sep 17 00:00:00 2001 From: Johannes Thoma Date: Tue, 20 Sep 2022 16:52:32 +0000 Subject: [PATCH] netcopy: Give --protect-args option to rsync for vm copy This prevents rsync from using a shell on the remote side to expand special characters. This makes transfer of files and directories containing whitespace work. Signed-Off-By: Johannes Thoma --- pkg/netcopy/netcopy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/netcopy/netcopy.go b/pkg/netcopy/netcopy.go index f19f689..742cda7 100644 --- a/pkg/netcopy/netcopy.go +++ b/pkg/netcopy/netcopy.go @@ -85,7 +85,7 @@ func (r *RsyncNetworkCopier) Copy(ctx context.Context, sources []HostPath, dest return fmt.Errorf("failed to close known hosts file: %w", err) } - args := []string{"--recursive", "--perms", "--times"} + args := []string{"--recursive", "--perms", "--times", "--protect-args"} for _, src := range sources { args = append(args, formatRsyncArg(src))