Skip to content

Commit 62bf4d2

Browse files
committed
Fix run_preps_on_packagedir rmtree race
with symlinks crossing mountpoints.
1 parent b24db1f commit 62bf4d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/CPAN/Distribution.pm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use File::Path ();
99
use POSIX ":sys_wait_h";
1010
@CPAN::Distribution::ISA = qw(CPAN::InfoObj);
1111
use vars qw($VERSION);
12-
$VERSION = "2.27_01"; # with cperl support
12+
$VERSION = "2.27_02"; # with cperl support
1313

1414
my $run_allow_installing_within_test = 1; # boolean; either in test or in install, there is no third option
1515
# no prepare, because prepare is not a command on the shell command line
@@ -612,8 +612,9 @@ See also http://rt.cpan.org/Ticket/Display.html?id=38932\n");
612612
}
613613
}
614614
$self->{build_dir} = $packagedir;
615-
$self->safe_chdir($builddir);
616-
File::Path::rmtree("tmp-$$");
615+
$self->safe_chdir(Cwd::abs_path($builddir));
616+
$self->debug("rmtree $builddir/tmp-$$") if $CPAN::DEBUG;
617+
File::Path::rmtree(File::Spec->catfile(Cwd::abs_path($builddir),"tmp-$$"));
617618

618619
$self->safe_chdir($packagedir);
619620
$self->_signature_business();

0 commit comments

Comments
 (0)