From: Scott Moser Date: Tue, 8 Oct 2013 00:41:23 +0000 (-0400) Subject: lxc-ubuntu-cloud: pass --numeric-owner and -p to untar X-Git-Tag: lxc-1.0.0.alpha2~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=494fd6b390ecae077375e171230ce78d6784dd43;p=thirdparty%2Flxc.git lxc-ubuntu-cloud: pass --numeric-owner and -p to untar Just following up here, Serge raised the question of whether or not the other two invocations of 'tar' in this script need '--numeric-owner'. They probably should have it, although its of little concern because the 'build_root_tgz' path is only taken if there is no '-root.tar.gz' file for download, and the only supported ubuntu release without the -root.tar.gz download is 10.04 at this point. Anyway, below is a more complete diff, also including a fix as '--numeric-uid' is not a valid option to tar. The name is '--numeric-owner'. Signed-off-by: Scott Moser Acked-by: Stéphane Graber --- diff --git a/templates/lxc-ubuntu-cloud.in b/templates/lxc-ubuntu-cloud.in index 47a5fcade..a2af0035e 100644 --- a/templates/lxc-ubuntu-cloud.in +++ b/templates/lxc-ubuntu-cloud.in @@ -340,7 +340,7 @@ build_root_tgz() echo "Creating new cached cloud image rootfs" tar --wildcards -zxf $tarname $imgname mount -o loop $imgname $xdir - (cd $xdir; tar zcf ../$filename .) + (cd $xdir; tar --numeric-owner -cpzf ../$filename .) umount $xdir rm -f $tarname $imgname rmdir $xdir @@ -371,7 +371,7 @@ do_extract_rootfs() { echo "Extracting container rootfs" mkdir -p $rootfs cd $rootfs - tar -zxf $cache/$filename + tar --numeric-owner -xpzf $cache/$filename } if [ -n "$tarball" ]; then