Preserve extended file attributes of extracted rootfs as described in
https://github.com/opencontainers/image-spec/blob/master/layer.md

Signed-off-by: Radostin Stoyanov <rstoyan...@gmail.com>
---
 src/virtBootstrap/utils.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/virtBootstrap/utils.py b/src/virtBootstrap/utils.py
index ec6a96e..94b3ccb 100644
--- a/src/virtBootstrap/utils.py
+++ b/src/virtBootstrap/utils.py
@@ -278,8 +278,12 @@ def safe_untar(src, dest):
     # Note: Here we use --absolute-names flag to get around the error message
     # "Cannot open: Permission denied" when symlynks are extracted, with the
     # qemu:/// driver. This flag must not be used outside virt-sandbox.
+    #
+    # Preserve file attributes following the specification in
+    # https://github.com/opencontainers/image-spec/blob/master/layer.md
     params = ['--', '/bin/tar', 'xf', src, '-C', '/mnt', '--exclude', 'dev/*',
-              '--overwrite', '--absolute-names']
+              '--overwrite', '--absolute-names',
+              '--acls', '--xattrs', '--selinux']
     execute(virt_sandbox + params)
 
 
-- 
2.14.3

_______________________________________________
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Reply via email to