[lxc-devel] [lxd/master] rsync: Filter out security.selinux

stgraber on Github lxc-bot at linuxcontainers.org
Thu Jul 2 14:23:50 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 370 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200702/89803320/attachment.bin>
-------------- next part --------------
From 3fe324a4a53002da8ff75066b71d198329897dd7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 2 Jul 2020 10:23:18 -0400
Subject: [PATCH] rsync: Filter out security.selinux
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #7607

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxc-to-lxd/transfer.go | 2 +-
 lxd-p2c/transfer.go    | 2 +-
 lxd/rsync/rsync.go     | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lxc-to-lxd/transfer.go b/lxc-to-lxd/transfer.go
index 57c85fbcb9..2868abc546 100644
--- a/lxc-to-lxd/transfer.go
+++ b/lxc-to-lxd/transfer.go
@@ -73,7 +73,7 @@ func rsyncSendSetup(path string, rsyncArgs string) (*exec.Cmd, net.Conn, io.Read
 		"--numeric-ids",
 		"--partial",
 		"--sparse",
-		"--xattrs",
+		"--xattrs", "--filter=-x security.selinux",
 		"--delete",
 		"--compress",
 		"--compress-level=2",
diff --git a/lxd-p2c/transfer.go b/lxd-p2c/transfer.go
index 9679212ae2..c052a350e3 100644
--- a/lxd-p2c/transfer.go
+++ b/lxd-p2c/transfer.go
@@ -77,7 +77,7 @@ func rsyncSendSetup(path string, rsyncArgs string) (*exec.Cmd, net.Conn, io.Read
 		"--numeric-ids",
 		"--partial",
 		"--sparse",
-		"--xattrs",
+		"--xattrs", "--filter=-x security.selinux",
 		"--delete",
 		"--compress",
 		"--compress-level=2",
diff --git a/lxd/rsync/rsync.go b/lxd/rsync/rsync.go
index b5b70a58ce..c6e2181965 100644
--- a/lxd/rsync/rsync.go
+++ b/lxd/rsync/rsync.go
@@ -44,7 +44,7 @@ func LocalCopy(source string, dest string, bwlimit string, xattrs bool, rsyncArg
 	}
 
 	if xattrs {
-		args = append(args, "--xattrs")
+		args = append(args, "--xattrs", "--filter=-x security.selinux")
 	}
 
 	if bwlimit != "" {
@@ -355,7 +355,7 @@ func Recv(path string, conn io.ReadWriteCloser, tracker *ioprogress.ProgressTrac
 func rsyncFeatureArgs(features []string) []string {
 	args := []string{}
 	if shared.StringInSlice("xattrs", features) {
-		args = append(args, "--xattrs")
+		args = append(args, "--xattrs", "--filter=-x security.selinux")
 	}
 
 	if shared.StringInSlice("delete", features) {


More information about the lxc-devel mailing list