From a2db63bf9703221cc49037285c4e0d00b019bee2 Mon Sep 17 00:00:00 2001 From: Steve Dondley Date: Mon, 13 Apr 2020 10:42:05 -0400 Subject: [PATCH] allow sudo to preserve permissions with rsync --- lib/Rex/Commands/Rsync.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Rex/Commands/Rsync.pm b/lib/Rex/Commands/Rsync.pm index 318f4142a..a6e796f8f 100644 --- a/lib/Rex/Commands/Rsync.pm +++ b/lib/Rex/Commands/Rsync.pm @@ -162,6 +162,7 @@ sub sync { if (Rex::is_sudo) { push @rsync_cmd, "--rsync-path='sudo rsync'"; + unshift @rsync_cmd, 'sudo'; } $cmd = join( " ", @rsync_cmd );