Bug#606661: perl-modules: File::Copy doesn't keep ownerships when copying or moving files across (NFS-)mounts
Gertjan Oude Lohuis
gertjan at byte.nl
Fri Dec 10 13:21:59 UTC 2010
Package: perl-modules
Version: 5.10.0-19lenny2
Severity: normal
I use File::Copy to copy() and move() files from one directory to another, both being NFS-mounts. However, information about ownership and accessrights is lost in the process. I've tested this on following systems:
* Debian Etch, perl-5.8.8, File::Copy 2.09
* Debian Lenny, backported perl-5.10, File::Copy 2.11
* Debian Squeeze, perl-5.10.1, File::Copy 2.14
* Debian Squeeze, perl-5.12.1, File::Copy 2.18
Results are the same on all systems.
How to repeat:
root at dev-gertjan1 /home # mkdir a
root at dev-gertjan1 /home # mkdir b
root at dev-gertjan1 /home # mount -t nfs nfshost:/fs1 a
root at dev-gertjan1 /home # mount -t nfs nfshost:/fs2 b
root at dev-gertjan1 /home # touch a/banaan
root at dev-gertjan1 /home # chown gertjan:gertjan a/banaan
root at dev-gertjan1 /home # chmod 600 a/banaan
root at dev-gertjan1 /home # ll a/banaan b/banaan
ls: cannot access b/banaan: No such file or directory
-rw------- 1 gertjan gertjan 0 Dec 10 12:37 a/banaan
root at dev-gertjan1 /home # perl -MFile::Copy -e 'warn $File::Copy::VERSION; warn copy "a/banaan", "b/banaan";'
2.18 at -e line 1.
1 at -e line 1.
root at dev-gertjan1 /home # ll a/banaan b/banaan
-rw------- 1 gertjan gertjan 0 Dec 10 12:37 a/banaan
-rw-r--r-- 1 root root 0 Dec 10 14:07 b/banaan
As you can see, b/banaan has now root:root as owner and is chmod 644, versus gertjan:gertjan and chmod 600 under a/.
I hope I'm not overlooking anything, but this behaviour doesn't seem right :). I've demonstrated the behaviour for copy(), but move() does exactly the same, probably because copy() is used internally since a rename is not possible.
I've also reported this bug to rt.perl.org: http://rt.perl.org/rt3/Public/Bug/Display.html?id=80530
-- System Information:
Debian Release: 5.0.7
APT prefers stable
APT policy: (600, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.32-bpo.5-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages perl-modules depends on:
ii perl 5.10.0-19lenny2 Larry Wall's Practical Extraction
perl-modules recommends no packages.
perl-modules suggests no packages.
-- no debconf information
More information about the Perl-maintainers
mailing list