[guest - Tue Jun 21 23:15:12 2005]:
Show quoted text> Here is the section that I am referring to:
>
> 167: ### set them all to be +w for the owner, so we don't get
> permission
> 168: ### denied for overwriting files that are just +r
> 169: chmod 0755, map { File::Spec->rel2abs( File::Spec->catdir($to,
> $_) ) }
> 170: @{$ae->files};
>
> This does more then change the file to be '+w' for the owner. It also
> sets the execute bit for the files also.
I've applied the following patch to only set mode +w for the owner, as this is the
bear minimum to make our functions work:
--
Jos
==== //depot/cpanplus/devel/lib/CPANPLUS/Internals/Extract.pm#41 - /Users/kane/
sources/p4/cpanplus/devel/lib/CPANPLUS/Internals/Extract.pm ====
169,170c169,178
< chmod 0755, map { File::Spec->rel2abs( File::Spec->catdir($to, $_) ) }
< @{$ae->files};
---
Show quoted text>
> ### this is to rigurous -- just change to +w for the owner [cpan #13358]
> #chmod 0755, map { File::Spec->rel2abs( File::Spec->catdir($to, $_) ) }
> # @{$ae->files};
>
> for my $file ( @{$ae->files} ) {
> my $path = File::Spec->rel2abs( File::Spec->catdir($to, $file) );
>
> $self->_mode_plus_w( file => $path );
> }
==== //depot/cpanplus/devel/lib/CPANPLUS/Internals/Utils.pm#21 - /Users/kane/
sources/p4/cpanplus/devel/lib/CPANPLUS/Internals/Utils.pm ====
287a288,310
Show quoted text> sub _mode_plus_w {
> my $self = shift;
> my %hash = @_;
>
> require File::stat;
>
> my $file;
> my $tmpl = {
> file => { required => 1, allow => IS_FILE, store => \$file },
> };
>
> check( $tmpl, \%hash ) or return;
>
> my $x = File::stat::stat( $file );
> if( $x and chmod( $x->mode|0200, $file ) ) {
> return 1;
>
> } else {
> error(loc("Failed to '%1' '%2': '%3'", 'chmod +w', $file, $!));
> return;
> }
> }
>
==== //depot/cpanplus/devel/t/00_CPANPLUS-Internals-Utils.t#10 - /Users/kane/
sources/p4/cpanplus/devel/t/00_CPANPLUS-Internals-Utils.t ====
24c24
< use Test::More tests => 31;
---
Show quoted text> use Test::More tests => 36;
39a40
Show quoted text> my $File = 'zot';
118a120,140
Show quoted text> ### _mode_plus_w tests ###
> { open my $fh, ">$File" or die "Could not open $File for writing: $!";
> close $fh;
>
> ### remove perms
> ok( -e $File, "File '$File' created" );
> ok( chmod( 000, $File ), " File permissions set to 000" );
>
> ok( $Class->_mode_plus_w( file => $File ),
> " File permissions set to +w" );
> ok( -w $File, " File is writable" );
>
> 1 while unlink $File;
>
> ok( !-e $File, " File removed" );
> }
>