GNU bug report logs - #65599
mv and cp give a pointless warning when moving/copying a directory

Previous Next

Package: coreutils;

Reported by: Bruno Haible <bruno <at> clisp.org>

Date: Tue, 29 Aug 2023 18:21:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 65599 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Bruno Haible <bruno <at> clisp.org>
Cc: 65599 <at> debbugs.gnu.org
Subject: Re: bug#65599: mv and cp give a pointless warning when moving/copying
 a directory
Date: Wed, 30 Aug 2023 21:58:33 -0700
[Message part 1 (text/plain, inline)]
On 2023-08-29 11:20, Bruno Haible wrote:
> People say that "chown only works for root anyway" [1]

I don't think that is the issue here. fchownat is failing with EACCES, 
which is supposed to mean that search permission is denied on a 
component of the path prefix, but in Android I guess EACCES also means 
the calling process doesn't have the required permissions to change 
ownership (i.e., errno should be EPERM according to POSIX).

Clearly search permission is allowed, since there's a successful 
utimensat call with the same file name. So EACCES does not mean search 
permission is denied; it means something else.

Do fchown, chown, and lchown have similar bugs on Android?

Although the attached hacky coreutils patch (which I haven't installed) 
might solve the immediate problem, it sounds like this is something that 
Gnulib's fchownat (and maybe related modules) should fix on Android, so 
that the fix is everywhere and not just in mv+cp.

[android.diff (text/x-patch, attachment)]

This bug report was last modified 1 year and 354 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.