From 20c0c7607ee11ef24e7453df2311d83e98af83a3 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Tue, 10 Apr 2018 17:10:14 +0100 Subject: docker-source: Preserve extended file attributes 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 --- 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) -- cgit