From: Jos I. Boumans Date: Sat, 13 Jun 2009 08:00:38 +0000 (+0200) Subject: Update to Archive::Tar 1.50 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1c82faa77213de8d77d404d205d3731944559f65;p=p5sagit%2Fp5-mst-13.2.git Update to Archive::Tar 1.50 --- diff --git a/lib/Archive/Tar.pm b/lib/Archive/Tar.pm index b504881..6d7fd78 100644 --- a/lib/Archive/Tar.pm +++ b/lib/Archive/Tar.pm @@ -22,7 +22,7 @@ require Exporter; use strict; use vars qw[$DEBUG $error $VERSION $WARN $FOLLOW_SYMLINK $CHOWN $CHMOD - $DO_NOT_USE_PREFIX $HAS_PERLIO $HAS_IO_STRING + $DO_NOT_USE_PREFIX $HAS_PERLIO $HAS_IO_STRING $SAME_PERMISSIONS $INSECURE_EXTRACT_MODE @ISA @EXPORT ]; @@ -31,9 +31,10 @@ use vars qw[$DEBUG $error $VERSION $WARN $FOLLOW_SYMLINK $CHOWN $CHMOD $DEBUG = 0; $WARN = 1; $FOLLOW_SYMLINK = 0; -$VERSION = "1.48"; +$VERSION = "1.50"; $CHOWN = 1; $CHMOD = 1; +$SAME_PERMISSIONS = $> == 0 ? 1 : 0; $DO_NOT_USE_PREFIX = 0; $INSECURE_EXTRACT_MODE = 0; @@ -806,7 +807,11 @@ sub _extract_file { ### only chmod if we're allowed to, but never chmod symlinks, since they'll ### change the perms on the file they're linking too... if( $CHMOD and not -l $full ) { - chmod $entry->mode, $full or + my $mode = $entry->mode; + unless ($SAME_PERMISSIONS) { + $mode &= ~(oct(7000) | umask); + } + chmod $mode, $full or $self->_error( qq[Could not chown '$full' to ] . $entry->mode ); } @@ -1761,6 +1766,15 @@ variable to C<0> to disable C-ing. The default is C<1>. +=head2 $Archive::Tar::SAME_PERMISSIONS + +When, C<$Archive::Tar::CHMOD> is enabled, this setting controls whether +the permissions on files from the archive are used without modification +of if they are filtered by removing any setid bits and applying the +current umask. + +The default is C<1> for the root user and C<0> for normal users. + =head2 $Archive::Tar::DO_NOT_USE_PREFIX By default, C will try to put paths that are over diff --git a/lib/Archive/Tar/t/src/header/signed.tar.packed b/lib/Archive/Tar/t/src/header/signed.tar.packed index 1fa99b3..9488569 100644 --- a/lib/Archive/Tar/t/src/header/signed.tar.packed +++ b/lib/Archive/Tar/t/src/header/signed.tar.packed @@ -10,7 +10,7 @@ To recreate it use the following command: uupacktool.pl -p lib/Archive/Tar/t/src/header/signed.tar lib/Archive/Tar/t/src/header/signed.tar.packed -Created at Tue Apr 21 11:50:41 2009 +Created at Fri Jun 12 14:05:33 2009 ######################################################################### __UU__ MPZ3#I,.D```````````````````````````````````````````````````` diff --git a/lib/Archive/Tar/t/src/linktest/linktest_missing_dir.tar.packed b/lib/Archive/Tar/t/src/linktest/linktest_missing_dir.tar.packed index 897641e..33a96f8 100644 --- a/lib/Archive/Tar/t/src/linktest/linktest_missing_dir.tar.packed +++ b/lib/Archive/Tar/t/src/linktest/linktest_missing_dir.tar.packed @@ -10,7 +10,7 @@ To recreate it use the following command: uupacktool.pl -p lib/Archive/Tar/t/src/linktest/linktest_missing_dir.tar lib/Archive/Tar/t/src/linktest/linktest_missing_dir.tar.packed -Created at Tue Apr 21 11:50:42 2009 +Created at Fri Jun 12 14:05:33 2009 ######################################################################### __UU__ M;&EN:W1EGH,8X``)O[A.90`D!``'^```#O*1X```%`""``E(*JGDA# diff --git a/lib/Archive/Tar/t/src/short/foo.tgz.packed b/lib/Archive/Tar/t/src/short/foo.tgz.packed index 61827fe..222302a 100644 --- a/lib/Archive/Tar/t/src/short/foo.tgz.packed +++ b/lib/Archive/Tar/t/src/short/foo.tgz.packed @@ -10,7 +10,7 @@ To recreate it use the following command: uupacktool.pl -p lib/Archive/Tar/t/src/short/foo.tgz lib/Archive/Tar/t/src/short/foo.tgz.packed -Created at Tue Apr 21 11:50:42 2009 +Created at Fri Jun 12 14:05:33 2009 ######################################################################### __UU__ M'XL(`````````^W300K",!"%X5GW%#G"3-JFYREJ080NJKU_A^A"$.RJ(\+_