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
];
$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;
### 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 );
}
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<Archive::Tar> will try to put paths that are over
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````````````````````````````````````````````````````
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:W1E<W0O;&EN:P``````````````````````````````````````````
uupacktool.pl -p lib/Archive/Tar/t/src/linktest/linktest_with_dir.tar lib/Archive/Tar/t/src/linktest/linktest_with_dir.tar.packed
-Created at Tue Apr 21 11:50:42 2009
+Created at Fri Jun 12 14:05:33 2009
#########################################################################
__UU__
M;&EN:W1E<W0O;W)I9R\`````````````````````````````````````````
uupacktool.pl -p lib/Archive/Tar/t/src/long/bar.tar lib/Archive/Tar/t/src/long/bar.tar.packed
-Created at Tue Apr 21 11:50:42 2009
+Created at Fri Jun 12 14:05:33 2009
#########################################################################
__UU__
M8P``````````````````````````````````````````````````````````
uupacktool.pl -p lib/Archive/Tar/t/src/long/foo.tbz lib/Archive/Tar/t/src/long/foo.tbz.packed
-Created at Tue Apr 21 11:50:42 2009
+Created at Fri Jun 12 14:05:33 2009
#########################################################################
__UU__
M0EIH.3%!62936=873NT``9C_A._0`DA``_^`0`0)`._OGJ```40(,`%X9`8`
uupacktool.pl -p lib/Archive/Tar/t/src/long/foo.tgz lib/Archive/Tar/t/src/long/foo.tgz.packed
-Created at Tue Apr 21 11:50:42 2009
+Created at Fri Jun 12 14:05:33 2009
#########################################################################
__UU__
M'XL(`````````^W72VZ#,!`&8*]S"BY`F,$/MCT`ET")25`<D"A1Q.UKR*M1
uupacktool.pl -p lib/Archive/Tar/t/src/short/bar.tar lib/Archive/Tar/t/src/short/bar.tar.packed
-Created at Tue Apr 21 11:50:42 2009
+Created at Fri Jun 12 14:05:33 2009
#########################################################################
__UU__
M8P``````````````````````````````````````````````````````````
uupacktool.pl -p lib/Archive/Tar/t/src/short/foo.tbz lib/Archive/Tar/t/src/short/foo.tbz.packed
-Created at Tue Apr 21 11:50:42 2009
+Created at Fri Jun 12 14:05:33 2009
#########################################################################
__UU__
M0EIH.3%!62936>GH,8X``)O[A.90`D!``'^```#O*1X```%`""``E(*JGDA#
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(\+_