Skip to content

Commit

Permalink
netcopy: Give --protect-args option to rsync for vm copy
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
johannesthoma authored and JoelColledge committed Sep 27, 2022
1 parent 1ddabd0 commit 5a018ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/netcopy/netcopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 5a018ac

Please sign in to comment.