bug#79433: 9.7: cp(1): lchownat(2/3) fallback bogus?

Paul Eggert <[email protected]>
Newsgroups gmane.comp.gnu.core-utils.bugs
Organization UCLA Computer Science Department
Message-ID <[email protected]>
On 2025-09-17 09:46, Steffen Nurpmeso wrote:
> (Just wondering, the final cp(1) should work for all
> configurable cases if config succeeds;

That sounds pretty ambitious! The main goal here is merely for coreutils 
to work on practical platforms.

> But that is not via fakeroot?

No, I'm not using fakeroot. I don't recommend using fakeroot for 
'configure', for all the usual reasons.

> Fakeroot fails to chown but ignores the error, yet the failed
> system call avoids getting the filestamp updated.

Clearly a bug in fakeroot. POSIX says the file timestamp must be updated.

> i do
> *not* want to be root in the namespace.

That's fine. 'configure' need not be run as root. I don't recommend 
running it as root.

> Having said all that, and fakeroot aside, GNU cp(1) should not
> exit error if it fails to preserve permissions for a symbolic link

GNU cp does not try to change the permissions of a symlink.

>    #?0|kent:tmp$ /bin/cp -a xb xc
>    cp: failed to preserve ownership for xc: Operation not supported

That's not preserving permissions; it's preserving ownership. It's a 
different system call, with quite different semantics.
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.