|
|
da373f |
From 38ecae6c0298943b4bc74d6d3d5c888ca0853dec Mon Sep 17 00:00:00 2001
|
|
|
da373f |
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
|
da373f |
Date: Thu, 13 Oct 2016 12:47:43 +0100
|
|
|
da373f |
Subject: [PATCH] tar-in: Add workaround because tar doesn't restore
|
|
|
da373f |
capabilities (RHBZ#1384241).
|
|
|
da373f |
|
|
|
da373f |
Current GNU tar does not restore all extended attributes. In
|
|
|
da373f |
particular only user.* capabilities are restored (although all
|
|
|
da373f |
are saved in the tarball).
|
|
|
da373f |
|
|
|
da373f |
To restore capabilities, SELinux security attributes, and other things
|
|
|
da373f |
we need to use --xattrs-include=*
|
|
|
da373f |
|
|
|
da373f |
For further information on the tar bug, see:
|
|
|
da373f |
https://bugzilla.redhat.com/show_bug.cgi?id=771927
|
|
|
da373f |
|
|
|
da373f |
(cherry picked from commit 6d0ab14b56743679638ead0829ff3131749ac59b)
|
|
|
da373f |
---
|
|
|
da373f |
daemon/tar.c | 6 +++++-
|
|
|
da373f |
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
|
da373f |
|
|
|
da373f |
diff --git a/daemon/tar.c b/daemon/tar.c
|
|
|
da373f |
index 300e99448..9464d7105 100644
|
|
|
da373f |
--- a/daemon/tar.c
|
|
|
da373f |
+++ b/daemon/tar.c
|
|
|
da373f |
@@ -188,7 +188,11 @@ do_tar_in (const char *dir, const char *compress, int xattrs, int selinux, int a
|
|
|
da373f |
"tar",
|
|
|
da373f |
dir, filter,
|
|
|
da373f |
chown_supported ? "" : "--no-same-owner ",
|
|
|
da373f |
- xattrs ? "--xattrs " : "",
|
|
|
da373f |
+ /* --xattrs-include=* is a workaround for a bug
|
|
|
da373f |
+ * in tar, and hopefully won't be required
|
|
|
da373f |
+ * forever. See RHBZ#771927.
|
|
|
da373f |
+ */
|
|
|
da373f |
+ xattrs ? "--xattrs --xattrs-include='*' " : "",
|
|
|
da373f |
selinux ? "--selinux " : "",
|
|
|
da373f |
acls ? "--acls " : "",
|
|
|
da373f |
error_file) == -1) {
|
|
|
da373f |
--
|
|
|
da373f |
2.18.4
|
|
|
da373f |
|