summaryrefslogtreecommitdiffstats
path: root/src/virtBootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'src/virtBootstrap')
-rw-r--r--src/virtBootstrap/utils.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/virtBootstrap/utils.py b/src/virtBootstrap/utils.py
index 94b3ccb..cd03a93 100644
--- a/src/virtBootstrap/utils.py
+++ b/src/virtBootstrap/utils.py
@@ -278,12 +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.
- #
+ params = ['--', '/bin/tar', 'xf', src, '-C', '/mnt', '--exclude', 'dev/*',
+ '--overwrite', '--absolute-names']
# 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',
- '--acls', '--xattrs', '--selinux']
+ if os.geteuid() == 0:
+ params.extend(['--acls', '--xattrs', '--selinux'])
execute(virt_sandbox + params)