Because if it's running as root, `tar` will implicitly unpack with the
owner and permissions the tarball was created with.


On Thu, Aug 1, 2013 at 5:29 PM, Josh Cooper <notifications@github.com>wrote:

> In lib/puppet/module_tool/applications/unpacker.rb:
>
> > @@ -37,7 +38,7 @@ def extract_module_to_install_dir
> >          build_dir.mkpath
> >          begin
> >            begin
> > -            Puppet::ModuleTool::Tar.instance(@module_name).unpack(@filename.to_s, build_dir.to_s)
> > +            Puppet::ModuleTool::Tar.instance(@module_name).unpack(@filename.to_s, build_dir.to_s, @module_path.stat.uid)
>
> @pvande <https://github.com/pvande> if running as root, why do we chown
> the file to the owner of the module directory?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/puppetlabs/puppet/pull/1810/files#r5544733>
> .
>