On Mon, Oct 07, 2013 at 08:41:23PM -0400, Scott Moser wrote:
> On Mon, 7 Oct 2013, Stéphane Graber wrote:
> 
> > On Mon, Oct 07, 2013 at 04:16:05PM -0500, Serge Hallyn wrote:
> > > An example of where this can break is if you pass in sshkey to user
> > > ubuntu in the container, where user ubuntu exists with different uid
> > > on host.
> > >
> > > Signed-off-by: Serge Hallyn <serge.hal...@ubuntu.com>
> >
> > Acked-by: Stéphane Graber <stgra...@ubuntu.com>
> 
> 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 <smo...@ubuntu.com>

Acked-by: Stéphane Graber <stgra...@ubuntu.com>

> 
> diff --git a/templates/lxc-ubuntu-cloud.in b/templates/lxc-ubuntu-cloud.in
> index 47a5fca..a2af003 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


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to