Author: ericwilhelm
Date: Thu Dec 11 12:05:50 2008
New Revision: 12146

Modified:
   Module-Build/trunk/Changes
   Module-Build/trunk/lib/Module/Build/Base.pm

Log:
lib/Module/Build/Base.pm - unset g/o write bits when using Archive::Tar 
(RT#39804)
Changes                  - update


Modified: Module-Build/trunk/Changes
==============================================================================
--- Module-Build/trunk/Changes  (original)
+++ Module-Build/trunk/Changes  Thu Dec 11 12:05:50 2008
@@ -15,6 +15,8 @@
  - Fix ~ expansion when $HOME is different from /etc/passwd as
    when running sudo.  [rt.cpan.org 39662]
  - Fixed a small POD error in the Cookbook. [Damyan Ivanov]
+ - Unset group/other write permission bits when using Archive::Tar to
+   build the dist tarball. (RT#39804) [David Golden]
 
  Enhancements
  - We now support a 'create_license' parameter to new() that will

Modified: Module-Build/trunk/lib/Module/Build/Base.pm
==============================================================================
--- Module-Build/trunk/lib/Module/Build/Base.pm (original)
+++ Module-Build/trunk/lib/Module/Build/Base.pm Thu Dec 11 12:05:50 2008
@@ -3788,7 +3788,12 @@
     # hack so that the resulting archive is compatible with older clients.
     $Archive::Tar::DO_NOT_USE_PREFIX = 0;
     my $files = $self->rscan_dir($dir);
-    Archive::Tar->create_archive("$file.tar.gz", 1, @$files);
+    my $tar = Archive::Tar->new;
+    $tar->add_files( @$files );
+    for my $f ( $tar->get_files ) {
+      $f->mode( $f->mode & ~022 ); # chmod go-w
+    }
+    $tar->write( "$file.tar.gz", 1 );
   }
 }
 

Reply via email to