Skip Menu |

This queue is for tickets about the ExtUtils-MakeMaker CPAN distribution.

Report information
The Basics
Id: 22033
Status: resolved
Priority: 0/
Queue: ExtUtils-MakeMaker

People
Owner: Nobody in particular
Requestors: TONVOON [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 6.31
Fixed in: (no value)



Subject: Test failure for rm_rf on a read-only directory
Not sure why, but my Debian 3.1 system (uname -a: "Linux hostname 2.4.27-2-386 #1 Mon May 16 16:47:51 JST 2005 i686 GNU/Linux") with perl 5.8.4 fails the t/Command.t test for ExtUtils-MakeMaker 6.31: ok 19 - change a dir to read-only Can't chdir to testdir (Permission denied) at blib/lib/ExtUtils/Command.pm line 108 not ok 20 - rm_rf can delete a read-only dir # Failed test 'rm_rf can delete a read-only dir' # in t/Command.t at line 178. ok 21 - temp directory not there yet On a MacOSX 10.4.7 system with perl 5.8.6, the same lines show: ok 19 - change a dir to read-only ok 20 - rm_rf can delete a read-only dir ok 21 - temp directory not there yet ExtUtils::MakeMaker 6.30 doesn't have this test. It looks like rmtree is not deleting the directory. Let me know if I can be of anymore help
Subject: Re: [rt.cpan.org #22033] Test failure for rm_rf on a read-only directory
Date: Wed, 11 Oct 2006 15:04:49 -0700
To: bug-ExtUtils-MakeMaker [...] rt.cpan.org
From: "Michael G Schwern" <schwern [...] gmail.com>
On 10/11/06, via RT <bug-ExtUtils-MakeMaker@rt.cpan.org> wrote: Show quoted text
> Not sure why, but my Debian 3.1 system (uname -a: "Linux hostname 2.4.27-2-386 #1 Mon > May 16 16:47:51 JST 2005 i686 GNU/Linux") with perl 5.8.4 fails the t/Command.t test for > ExtUtils-MakeMaker 6.31: > > ok 19 - change a dir to read-only > Can't chdir to testdir (Permission denied) at blib/lib/ExtUtils/Command.pm line 108 > not ok 20 - rm_rf can delete a read-only dir > # Failed test 'rm_rf can delete a read-only dir' > # in t/Command.t at line 178. > ok 21 - temp directory not there yet > > On a MacOSX 10.4.7 system with perl 5.8.6, the same lines show: > > ok 19 - change a dir to read-only > ok 20 - rm_rf can delete a read-only dir > ok 21 - temp directory not there yet > > ExtUtils::MakeMaker 6.30 doesn't have this test. It looks like rmtree is not deleting the > directory. Let me know if I can be of anymore help
That's very strange because neither ExtUtils::Command nor File::Path (which is what rm_rf() uses) call chdir(). Looking at Debian's patches to 5.8.4... http://ftp.debian.org/debian/pool/main/p/perl/perl_5.8.4-8sarge5.diff.gz I see they'd done extensive rework of File::Path which includes attempting to chdir into the directory being deleted. So I'd say your Perl is broke. To be sure, try this: $ rmdir foo $ mkdir foo $ chmod 400 foo $ ls -ld foo dr-------- 2 schwern schwern 68 Oct 11 14:56 foo $ perl -MFile::Path -wle 'rmtree "foo"' $ ls -ld foo ls: foo: No such file or directory Debian reworked File::Path to close some potential security holes. Those have been fixed upstream but after 5.8.4. [ 23953] By: rgs on 2005/02/09 09:28:19 Log: Patch for CAN-2004-0452 by Jeroen van Wolffelaar. The rmtree() function in the perl File::Path module would remove directories in an insecure manner which could lead to the removal of arbitrary files and directories via a symlink attack. Branch: perl ! lib/File/Path.pm Debian's Perl in testing (5.8.8-6.1) does not make any changes to File::Path and should work fine. Upgrade perl to Debian's testing or install your own. http://www.us.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html#s-default-version explains how to do this without much fuss.
No response in 7 years. Closing ticket.