This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make the setting of write-bits safer in Porting\makerel
authorSteve Hay <steve.m.hay@googlemail.com>
Mon, 13 Sep 2010 20:32:50 +0000 (21:32 +0100)
committerSteve Hay <steve.m.hay@googlemail.com>
Mon, 13 Sep 2010 20:32:50 +0000 (21:32 +0100)
When rolling a release on Windows it is useful to use the Cygwin tools, but
the chmod command doesn't honour the user's umask when operating outside of
the Cygwin bash shell. For example, with a umask of 0022 and a file having
permissions 0400, one would expect "chmod +w" to change the file's
permissions to 0600. It does inside the Cygwin bash shell, but inside the
standard Windows command prompt it changes the file permissions to 0622
instead.

The problem is avoided by using "chmod u+w" instead to be sure that we only
set the write-bit for the owner user.

Note that the PAUSE indexer now detects uploads containining world writable
files or directories and will not index them. In such cases, it generates
new tarballs with "-withoutworldwritables" injected into the names and
indexes those instead of the original uploads. We do not want this
happening to perl distributions!

Porting/makerel

index 4d31c70..2f84548 100755 (executable)
@@ -161,7 +161,7 @@ my @writables = qw(
     utils/Makefile
     uconfig.h
 );
-system("chmod +w @writables") == 0
+system("chmod u+w @writables") == 0
     or die "system: $!";
 
 chdir ".." or die $!;