Re: Bug in error when "mv" when you don't have access to source file
From:
Philip Rowlands
Subject:
Re: Bug in error when "mv" when you don't have access to source file
Date:
Mon, 26 Nov 2007 13:31:21 +0000 (GMT)
On Mon, 26 Nov 2007, Quintin Beukes wrote:
This is a copy of the sequence of commands with which to reproduce this
problem.
--------------------------------------------
address@hidden admin_scripts $ sudo mkdir /tmp/mvbug
address@hidden admin_scripts $ sudo touch /tmp/mvbug/file
address@hidden admin_scripts $ mv /tmp/mvbug/file /tmp/file1
mv: cannot move `/tmp/mvbug/file' to `/tmp/file1': Permission denied
address@hidden admin_scripts $ mv /tmp/mvbug/file .
mv: cannot remove `/tmp/mvbug/file': Not a directory
address@hidden admin_scripts $ mv /tmp/mvbug/file ./
mv: cannot remove `/tmp/mvbug/file': Not a directory
--------------------------------------------
You don't specify whether "." is on a different filesystem; this affects
whether mv can use a rename(2) syscall, or has to copy and delete. I
suspect "." is not on the same filesystem as /tmp, in which case the
strace output looks like this:
I agree that mv's diagnostic message doesn't correspond to the syscall
return value. Will have to dig around the source and see if I can spot
what causes this.