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