Skip Menu |
 

This queue is for tickets about the File-Path CPAN distribution.

Report information
The Basics
Id: 34701
Status: resolved
Priority: 4/
Queue: File-Path

People
Owner: dland [...] cpan.org
Requestors: KES [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.04
Fixed in: (no value)



Subject: rmtree failed
I got next message when try rmtree $tmpDir, {keep_root => 1, verbose => 0}; ... rmtree $tmpDir, {verbose => 0}; directory \\server\buildsystem\lintbuilds\scripts3\..\temp\0.8096923828125 changed before chdir, expected dev=3 inode=0, actual dev=-1 ino=0, aborting. at //server/buildsystem/lintbuilds/scripts3/build.pl line 153 Script was runned as: perl //server/buildsystem/lintbuilds/scripts3/build.pl D:\temp>perl -v This is perl, v5.8.8 built for MSWin32-x86-multi-thread (with 50 registered patches, see perl -V for more detail) Copyright 1987-2006, Larry Wall Binary build 820 [274739] provided by ActiveState http://www.ActiveState.com Built Jan 23 2007 15:57:46 Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. OS: WinXP_SP2
Download (untitled) / with headers
text/plain 979b
On Sat Apr 05 09:26:14 2008, KES wrote: Show quoted text
> I got next message when try > rmtree $tmpDir, {keep_root => 1, verbose => 0}; > ... > rmtree $tmpDir, {verbose => 0};
You're trying to delete the directory you're in? That doesn't play nicely with the new code in place to prevent race conditions (and system attacks). You should chdir to the parent directory just before doing that. A portable way of doing that would be use File::Spec; chdir(File::Spec->updir) or die $!; Show quoted text
> directory > \\server\buildsystem\lintbuilds\scripts3\..\temp\0.8096923828125 changed > before chdir, expected dev=3 inode=0, actual dev=-1 ino=0, aborting. at > //server/buildsystem/lintbuilds/scripts3/build.pl line 153 > > Script was runned as: > perl //server/buildsystem/lintbuilds/scripts3/build.pl
stat on Windows doesn't return sane values for volume information (in terms of rmtree'ing a UNC path. I have to release a new version to deal with that. Thanks for the report, David Landgren
Download (untitled) / with headers
text/plain 502b
Show quoted text
> > I got next message when try > > rmtree $tmpDir, {keep_root => 1, verbose => 0}; > > ... > > rmtree $tmpDir, {verbose => 0};
> > You're trying to delete the directory you're in?
No I do not. I am on local machine at D:/temp/ and try to delete directory from server \\server\buildsystem\lintbuilds\scripts3\..\temp\0.8096923828125 Problem exists only if path to delete contain '..' directories There is no error if I supply path as: \\server\buildsystem\lintbuilds\temp\0.8096923828125
Download (untitled) / with headers
text/plain 912b
On Wed Apr 09 09:00:45 2008, KES wrote: Show quoted text
> > > I got next message when try > > > rmtree $tmpDir, {keep_root => 1, verbose => 0}; > > > ... > > > rmtree $tmpDir, {verbose => 0};
> > > > You're trying to delete the directory you're in?
> > No I do not. > I am on local machine at D:/temp/ and try to delete directory from server > \\server\buildsystem\lintbuilds\scripts3\..\temp\0.8096923828125 > > Problem exists only if path to delete contain '..' directories > > There is no error if I supply path as: > \\server\buildsystem\lintbuilds\temp\0.8096923828125
Right, sorry about the mis-diagnosis. This actually the fault of stat failing to work correctly with UNC paths. Clive Darke has written a module called Win32::IdentifyFile which I should be able to use to work around this problem. Of course, the module would have to be installed locally in the first place... Thanks for the report, David
From: demasb [...] yahoo.com
Download (untitled) / with headers
text/plain 864b
Has there been a patch created for this issue? I ran into a similar problem with file::path rmtree as well. I try to pass an absolute path similar to this: //some.net.drive_mount_pt/dir1/dir2/dir_to_be_deleted and get this error: directory//some.net.drive_mount_pt/dir1/dir2/dir_to_be_deleted changed before chdir, expected dev=16 inode=0, actual dev=-1 ino=0, aborting. If I pass the letter drive mounted to this mount point, it works fine: q:/dir1/dir2/dir_to_be_deleted In my environment I need to use the drive mount point to refer to the directory, not the letter drive. When I run my code, the working directory is not in the directory tree that I am trying to delete. my perl -v info: v5.10.0 built for MSWin32-x86-multi-thread Binary build 1002 [283697] provided by ActiveState http://www.ActiveState.com Built Jan 10 2008 11:00:53 thanks Bill
Download (untitled) / with headers
text/plain 264b
On Fri Apr 17 11:56:36 2009, demasb wrote: Show quoted text
> Has there been a patch created for this issue?
Yes, this has been resolved in the development release 2.07_03. I have just release 2.08, which is now progating itself across CPAN, and contains the fix. Regards, David


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.