Subject: | failed dircopy does not propagate in recursion |
File-Copy-Recursive-0.38
Perl v5.8.8
This bug is related to the dircopy function.
When copying a file in a directory fails it is not propagated to the
return of the dircopy function. This only happens if the file is copied
recursively.
step by step
-------------------------
$ mkdir -p a/b
$ touch a/b/file
$ chmod 000 a/b/file
$ perl -e 'use File::Copy::Recursive qw(dircopy); dircopy("a", "a_copy")
or die "Can not copy $!";'
-------------------------
This should die because you do not have permission to copy the file.
Patch is attached.
Subject: | Recursive.patch |
--- Recursive.pm 2008-11-20 15:38:20.000000000 +0100
+++ Recursive2.pm 2008-12-17 11:00:28.000000000 +0100
@@ -247,8 +247,8 @@
symlink readlink($org), $new or return;
}
elsif(-d $org) {
- $recurs->($org,$new,$buf) if defined $buf;
- $recurs->($org,$new) if !defined $buf;
+ $recurs->($org,$new,$buf) or return if defined $buf;
+ $recurs->($org,$new) or return if !defined $buf;
$filen++;
$dirn++;
}