[virt-bootstrap] [PATCH 5/5] docker-source: Preserve extended file attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <rstoyanov1@xxxxxxxxx>
---
 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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux