diff options
author | Radostin Stoyanov <rstoyanov1@gmail.com> | 2017-08-26 21:41:51 +0100 |
---|---|---|
committer | Radostin Stoyanov <rstoyanov1@gmail.com> | 2017-08-28 15:56:20 +0100 |
commit | a48353f83374c37480c98c463363873b95058e5f (patch) | |
tree | 3588a8694140769fdaff626f39755ef3df8e4754 /tests | |
parent | d8d28f3d9d75a82d4e8421c6a7a95a456fb7ed00 (diff) | |
download | virt-bootstrap.git-a48353f83374c37480c98c463363873b95058e5f.tar.gz virt-bootstrap.git-a48353f83374c37480c98c463363873b95058e5f.tar.xz virt-bootstrap.git-a48353f83374c37480c98c463363873b95058e5f.zip |
Improve untar command
Add "--overwrite" to enforce the overwrite of existing files.
Add the flag "--absolute-names" to disable the strip of leading '/'s
This is used to get around the error "Cannot open:Permission denied"
which occurs when the qemu driver is used by virt-sandbox. It is used
for unprivileged users to create isolated environment in which tar is
executed to extract the content from container image layers.
In particular this error occurs when the tar archive contains symbolic
link which has target path starting with '/'.
Steps to reproduce:
$ mkdir /tmp/foo
$ cd /tmp/foo
$ touch file
$ ln -s /tmp/foo/file link
$ tar -cf archive.tar link
$ mkdir /tmp/foo/dest
$ virt-sandbox -c qemu:///session \
-m host-bind:/mnt=/tmp/foo/dest \
-- /bin/tar xf /tmp/foo/archive.tar -C /mnt
Error message:
tar: link: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions