On Thu May 28 11:30:59 2009, DAGOLDEN wrote:
Show quoted text> On Thu, May 28, 2009 at 8:20 AM, John Lightsey via RT
> <bug-CPAN@rt.cpan.org> wrote:
> > I'd say it's a bit of both. It would make sense for Archive::Tar to
> > provide equivalent functionality to tar's --no-same-permissions flag
> > (chmod while applying umask), but it doesn't. Given the limitations
> > Archive::Tar has though, CPAN is using it incorrectly.
>
> There was a big discussion about the security implications of
> permissions and the decision taken at the time was to use the user's
> umask.
That's understandable, but the $Archive::Tar::CHMOD=0 setting doesn't
just apply the umask. It ignores the permissions in the archive and
leaves files with whatever permissions they would get with a normal file
open/write/close. For instance, if the permissions are 0700 in the
archive, $Archive::Tar::CHMOD=0 will leave them as 0644 (assuming umask
of 0022.)
I'm completely in agreement that Archive::Tar should provide the
capability to do the same thing as GNU tar's --no-same-permissions flag
though (remove setuid/setgid and apply umask.)
Show quoted text>
> What in Mail::SpamAssassin requires the executable bit to be set when
> unpacked and is there an alternative to that assumption? (E.g.
> Makefile.PL can set anything executable that needs it.)
Mail::Spamassassin's Makefile.PL runs "perl spamc/configure.pl" which in
turn runs the autoconf generated "spamc/configure" script with arguments.
You could certainly make the argument that CPAN modules should never
expect the shebang line to work and should always call /bin/sh
explicitly, but it wasn't an issue before CPAN 1.94. NetAddr::IP also
fails to install for the same reason. I'd bet there are others, but
those are what I see on my system.
Show quoted text>
> $Archive::Tar::CHOWN is 1 by default and CPAN.pm doesn't change that,
> so I'm surprised that you're seeing the ownership not change. Which
> tarball specifically did you observed that on and were you running as
> root (or under sudo) at the time?
Right. The ownership in the archive should be ignored.
$Archive::Tar::CHOWN=1 only matters when you're running as root and in
that circumstance it always does the wrong thing. You don't want CPAN
to make lots of files that belong to the random UID's that created the
tarballs. For example, when I install Module::Build on my system it
gets extracted into the CPAN build directory like this:
drwxr-xr-x 3 root root 4.0K May 28 17:15 lib
-rw-r--r-- 1 500 defvhost 19K May 3 22:20 LICENSE
-rw-r--r-- 1 root root 3.5K May 28 17:15 Makefile
-rw-r--r-- 1 500 defvhost 388 May 3 22:20 Makefile.PL
If $Archive::Tar::CHOWN was set to 0 these would all be owned by root.