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

Previous Next

Package: coreutils;

Reported by: Steffen Nurpmeso <steffen <at> sdaoden.eu>

Date: Thu, 11 Sep 2025 11:51:02 UTC

Severity: normal

Found in version 9.7

Full log


View this message in rfc822 format

From: Steffen Nurpmeso <steffen <at> sdaoden.eu>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 79433 <at> debbugs.gnu.org
Subject: bug#79433: 9.7: cp(1): lchownat(2/3) fallback bogus?
Date: Thu, 18 Sep 2025 14:57:10 +0200
Paul Eggert wrote in
 <cc4dea61-3ed8-4224-ab49-d48bb34af37a <at> cs.ucla.edu>:
 |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.

I think there are / have been filesystems with a time resolution
smaller than one second.

 ...
 |>    #?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.

The GNU autoconf result of coreutils / cp results in a code
path that does not work the way it should.  That much is plain,
and that i reported.  I am not looking into GNU autoconf aka the
conclusions of GNU coreutils and the resulting coreutils / gnulib
/ GNU libc module / overlay / patchwork fusion which results.
Also since i went several times for you in the past and have been
dismissed drastically, just like again this time.

I also disagree with "practical platforms" given that the
effective log difference seems to be (from a diff(1) glance)

  +#define CHOWN_CHANGE_TIME_BUG 1
  +#define MKNOD_FIFO_BUG 1

The latter seems to come from

	configure:65539: checking whether mknod can create fifo without root privileges
	...
	configure:65580: $? = 99
	...
	| /* Indeterminate for super-user, assume no.  Why are you running
	|          configure as root, anyway?  */
	|       if (geteuid () == ROOT_UID) return 99;
	|       if (mknod ("conftest.fifo", S_IFIFO | 0600, 0)) return 2;
	|   ;
	|   return 0;
	| }
	configure:65601: result: no

Not a bug.
All in all the two above, plus some getgroups() difference should not result in
a disfunctional cp(1) i would think.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)




This bug report was last modified 1 day ago.

Previous Next


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