Re: bug in mv (fileutils) 4.1

Kevin Layer <[email protected]>
Newsgroups gmane.comp.gnu.fileutils.bugs
Message-ID <[email protected]>
>> crikey% ls -lR tmp/test_18
>> tmp/test_18:
>> total 4
>> drwxr-xr-x    2 layer    fi           4096 Nov 21 11:29 bar/
>> lrwxrwxrwx    1 layer    fi              3 Nov 21 11:29 foo -> bar/
>> 
>> tmp/test_18/bar:
>> total 4
>> -rw-r--r--    1 layer    fi             51 Nov 21 11:29 foo_18
>> 
>> crikey% mv tmp/test_18/foo/ tmp/test_18/baz

Btw, here's an strace of the mv:

...
rename("tmp/test_18/foo/", "tmp/test_18/baz") = -1 ENOTDIR (Not a directory)
unlink("tmp/test_18/baz")               = -1 ENOENT (No such file or directory)
mkdir("tmp/test_18/baz", 040755)        = 0
stat64("tmp/test_18/baz", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/dev/null", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = -1 ENOTDIR (Not a directory)
open("tmp/test_18/foo/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
fcntl64(0x3, 0x2, 0x1, 0x40155400)      = 0
brk(0x8057000)                          = 0x8057000
getdents64(0x3, 0x8054350, 0x1000, 0)   = 80
getdents64(0x3, 0x8054350, 0x1000, 0)   = 0
close(3)                                = 0
lstat64("tmp/test_18/foo/foo_18", {st_mode=S_IFREG|0644, st_size=51, ...}) = 0
open("tmp/test_18/foo/foo_18", O_RDONLY|O_LARGEFILE) = 3
open("tmp/test_18/baz/foo_18", O_WRONLY|O_CREAT|O_LARGEFILE, 0100644) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=51, ...}) = 0
read(3, "this is tmp/test_18/bar/foo_18 i"..., 4096) = 51
write(4, "this is tmp/test_18/bar/foo_18 i"..., 51) = 51
read(3, "", 4096)                       = 0
close(4)                                = 0
close(3)                                = 0
utime("tmp/test_18/baz/foo_18", [2002/11/21-13:39:05, 2002/11/21-13:39:05]) = 0
chown32(0x8054340, 0x1e3, 0x32)         = 0
chmod("tmp/test_18/baz/foo_18", 0100644) = 0
utime("tmp/test_18/baz", [2002/11/21-13:39:15, 2002/11/21-13:39:05]) = 0
chown32(0xbffffbc4, 0x1e3, 0x32)        = 0
chmod("tmp/test_18/baz", 040755)        = 0
lstat64("tmp/test_18/foo", {st_mode=S_IFLNK|0777, st_size=3, ...}) = 0
unlink("tmp/test_18/foo")               = 0
_exit(0)                                = ?
crikey% 



Perhaps it's a combination of bugs in rename() and how that bug is
handled by `mv'?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.