Philipp Marek <[EMAIL PROTECTED]> wrote:
> X-Reportbug-Version: 3.39
> X-Debbugs-Cc: [EMAIL PROTECTED]
> Package: coreutils
> Version: 6.0-1
> Severity: minor
>
>
> If I try to "mv" a file in /tmp (which is 1777) that doesn't belong
> to my user, "mv" prints
>       mv: cannot remove `/tmp/a': Not a directory
> which is clearly misleading - it should print "Operation not permitted".
>
> strace shows some legacy behaviour - trying to unlink(), then rmdir(),

That's not legacy behavior.  However, it is rather
obtuse code (esp when seen only via strace) because it
tries hard to be both secure and efficient.

> although it knows that it's a file (it just copied it
> [because it got EXDEV {Invalid cross-device link}] :-).
>
>       close(6)                                = 0
>       close(5)                                = 0
>       unlink("/tmp/a")                        = -1 EPERM (Operation not 
> permitted)
>       open("/tmp/a", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW) = 5
>       fstat(5, {st_mode=S_IFREG|0644, st_size=681564, ...}) = 0
>       close(5)                                = 0
>       rmdir("/tmp/a")                         = -1 EPERM (Operation not 
> permitted)

Thanks for the report.
That was fixed upstream just a day or two ago:

  http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=b4148f567d9bf7



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to