Files
Sylvestre Ledru bd170a5d4b cp: strip setuid/setgid when chown fails during -p (#9750)
When `cp -p` cannot chown the destination to the source's owner
(e.g. a non-root user copying a root-owned setuid file), GNU cp
strips the setuid and setgid bits from the applied mode so the
destination does not give the copying user elevated privileges via
the copy. uutils was unconditionally applying the source mode,
producing user-owned files with a live setuid bit.

Track `ownership_preserved` alongside the existing chown retry
logic and, in the subsequent `handle_preserve(mode, ...)` block,
mask off `0o6000` from the source's mode when ownership could not
be preserved. The sticky bit (01000) is kept, matching GNU.
2026-05-06 11:47:38 +02:00
..
2026-04-27 11:31:19 +02:00
2026-04-17 07:24:13 +02:00
2026-02-19 14:44:42 +01:00
2026-03-30 15:32:39 +02:00
2026-05-06 08:35:00 +02:00
2026-04-27 09:16:56 +02:00
2026-04-28 14:24:49 +02:00
2026-04-29 11:03:10 +02:00
2026-04-30 14:45:28 +02:00