Re: [PATCH] cp: clear special mode bits on --parents when preserving own
From:
Collin Funk
Subject:
Re: [PATCH] cp: clear special mode bits on --parents when preserving ownership fails
Date:
Tue, 17 Nov 2026 19:04:36 -0800
User-agent:
Gnus/5.13 (Gnus v5.13)
Collin Funk <collin.funk1@gmail.com> writes:
> Pádraig Brady <P@draigBrady.com> writes:
>
>> On 17/11/2026 02:55, Collin Funk wrote:
>>> * src/cp.c (re_protect): Clear special mode bits when lchownat fails.
>>> * tests/cp/special-bits.sh: Add a test case.
>>> * NEWS: Mention the bug fix.
>>
>> I think this may also be needed to handle the `cp --preserve=owner
>> --parents` case?
>
> I was thinking about that today as well. Let me do some more testing.
I think my original patch is correct. I've attached a v2 patch with some
additional tests. If you add your change, you'll see the sticky bit is
missed when using --preserve=owner.
Collin