GNU bug report logs -
#63245
Potential regression: cp --preserve=mode or --preserve=all fails to copy files from subdirectory
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 63245 in the body.
You can then email your comments to 63245 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-coreutils <at> gnu.org
:
bug#63245
; Package
coreutils
.
(Wed, 03 May 2023 12:49:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Schlomo Schapiro <schlomo <at> schapiro.org>
:
New bug report received and forwarded. Copy sent to
bug-coreutils <at> gnu.org
.
(Wed, 03 May 2023 12:49:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello,
I'm a maintainer of the Relax-and-Recover (https://relax-and-recover.org/)
Open Source project and think that I might have found a major regression in
cp, starting somewhere with version 9.
Please see https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/2017414
and https://github.com/rear/rear/issues/2972 for how I found out about this.
Problem:
We use a cp call like the following to copy various files and directory
into a destination path with preserving the structure:
cp --verbose -t DESTINATION -L --preserve=all --parents SOURCE...
Over the last 10+ years that worked well on all Linux distros (ReaR is
build for and tested on nearly all distros), but I recently found out that
on Ubuntu 23.04 this fails like this:
# rm -Rf /tmp/f && mkdir /tmp/f && cp --verbose -t /tmp/f -L --preserve=all
--parents /etc/apt/sources.list && echo yes ; ls -lR
/tmp/f/etc/apt/sources.list
/etc/apt/sources.list
/etc -> /tmp/f/etc
/etc/apt -> /tmp/f/etc/apt
'/etc/apt/sources.list' -> '/tmp/f/etc/apt/sources.list'
cp: ‘etc/apt’: No such file or directory
-rw-r--r-- 1 root root 2437 Apr 23 09:53 /etc/apt/sources.list
-rw-r--r-- 1 root root 2437 Apr 23 09:53 /tmp/f/etc/apt/sources.list
#
Ubuntu 23.04 uses cp (GNU coreutils) 9.1
On Ubuntu 22.04 there is cp (GNU coreutils) 8.32 and the same example works
as expected:
# rm -Rf /tmp/f && mkdir /tmp/f && cp --verbose -t /tmp/f -L --preserve=all
--parents /etc/apt/sources.list && echo yes ; ls -lR
/tmp/f/etc/apt/sources.list /etc/apt/sources.list
/etc -> /tmp/f/etc
/etc/apt -> /tmp/f/etc/apt
'/etc/apt/sources.list' -> '/tmp/f/etc/apt/sources.list'
yes
-rw-r--r-- 1 root root 263 Mär 26 15:20 /etc/apt/sources.list
-rw-r--r-- 1 root root 263 Mär 26 15:20 /tmp/f/etc/apt/sources.list
#
BTW, I checked also on many other distros that ReaR supports and all
distros with cp version 9.1 fail in the same way.
Can you please have a look and advise how to proceed? We at the ReaR
project can of course change our code to use tar for example, but I won't
be surprised if other users will also meet this changed behaviour and maybe
it is indeed a bug.
Kind regards,
Schlomo Schapiro
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#63245
; Package
coreutils
.
(Wed, 03 May 2023 16:41:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 63245 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 03/05/2023 10:27, Schlomo Schapiro wrote:
> Hello,
>
> I'm a maintainer of the Relax-and-Recover (https://relax-and-recover.org/)
> Open Source project and think that I might have found a major regression in
> cp, starting somewhere with version 9.
>
> Please see https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/2017414
> and https://github.com/rear/rear/issues/2972 for how I found out about this.
>
> Problem:
>
> We use a cp call like the following to copy various files and directory
> into a destination path with preserving the structure:
>
> cp --verbose -t DESTINATION -L --preserve=all --parents SOURCE...
>
> Over the last 10+ years that worked well on all Linux distros (ReaR is
> build for and tested on nearly all distros), but I recently found out that
> on Ubuntu 23.04 this fails like this:
>
> # rm -Rf /tmp/f && mkdir /tmp/f && cp --verbose -t /tmp/f -L --preserve=all
> --parents /etc/apt/sources.list && echo yes ; ls -lR
> /tmp/f/etc/apt/sources.list
> /etc/apt/sources.list
> /etc -> /tmp/f/etc
> /etc/apt -> /tmp/f/etc/apt
> '/etc/apt/sources.list' -> '/tmp/f/etc/apt/sources.list'
> cp: ‘etc/apt’: No such file or directory
> -rw-r--r-- 1 root root 2437 Apr 23 09:53 /etc/apt/sources.list
> -rw-r--r-- 1 root root 2437 Apr 23 09:53 /tmp/f/etc/apt/sources.list
> #
>
> Ubuntu 23.04 uses cp (GNU coreutils) 9.1
>
> On Ubuntu 22.04 there is cp (GNU coreutils) 8.32 and the same example works
> as expected:
>
> # rm -Rf /tmp/f && mkdir /tmp/f && cp --verbose -t /tmp/f -L --preserve=all
> --parents /etc/apt/sources.list && echo yes ; ls -lR
> /tmp/f/etc/apt/sources.list /etc/apt/sources.list
> /etc -> /tmp/f/etc
> /etc/apt -> /tmp/f/etc/apt
> '/etc/apt/sources.list' -> '/tmp/f/etc/apt/sources.list'
> yes
> -rw-r--r-- 1 root root 263 Mär 26 15:20 /etc/apt/sources.list
> -rw-r--r-- 1 root root 263 Mär 26 15:20 /tmp/f/etc/apt/sources.list
> #
>
> BTW, I checked also on many other distros that ReaR supports and all
> distros with cp version 9.1 fail in the same way.
>
> Can you please have a look and advise how to proceed? We at the ReaR
> project can of course change our code to use tar for example, but I won't
> be surprised if other users will also meet this changed behaviour and maybe
> it is indeed a bug.
Looks like a bug indeed.
The attached patch should address this in coreutils.
Any deployments of coreutils 9.1-9.3 inclusive would need to apply this.
thanks,
Pádraig
[cp-abs-parents.patch (text/x-patch, attachment)]
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#63245
; Package
coreutils
.
(Wed, 03 May 2023 17:47:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 63245 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi Pádraig,
Wow, nice! That was really quick!
how would this patch get into the affected distros as a bugfix? Then it
would actually help me as I can't ship a patched coreutils with ReaR.
Kind regards,
Schlomo
On Wed, 3 May 2023 at 18:40, Pádraig Brady <P <at> draigbrady.com> wrote:
> On 03/05/2023 10:27, Schlomo Schapiro wrote:
> > Hello,
> >
> > I'm a maintainer of the Relax-and-Recover (
> https://relax-and-recover.org/)
> > Open Source project and think that I might have found a major regression
> in
> > cp, starting somewhere with version 9.
> >
> > Please see
> https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/2017414
> > and https://github.com/rear/rear/issues/2972 for how I found out about
> this.
> >
> > Problem:
> >
> > We use a cp call like the following to copy various files and directory
> > into a destination path with preserving the structure:
> >
> > cp --verbose -t DESTINATION -L --preserve=all --parents SOURCE...
> >
> > Over the last 10+ years that worked well on all Linux distros (ReaR is
> > build for and tested on nearly all distros), but I recently found out
> that
> > on Ubuntu 23.04 this fails like this:
> >
> > # rm -Rf /tmp/f && mkdir /tmp/f && cp --verbose -t /tmp/f -L
> --preserve=all
> > --parents /etc/apt/sources.list && echo yes ; ls -lR
> > /tmp/f/etc/apt/sources.list
> > /etc/apt/sources.list
> > /etc -> /tmp/f/etc
> > /etc/apt -> /tmp/f/etc/apt
> > '/etc/apt/sources.list' -> '/tmp/f/etc/apt/sources.list'
> > cp: ‘etc/apt’: No such file or directory
> > -rw-r--r-- 1 root root 2437 Apr 23 09:53 /etc/apt/sources.list
> > -rw-r--r-- 1 root root 2437 Apr 23 09:53 /tmp/f/etc/apt/sources.list
> > #
> >
> > Ubuntu 23.04 uses cp (GNU coreutils) 9.1
> >
> > On Ubuntu 22.04 there is cp (GNU coreutils) 8.32 and the same example
> works
> > as expected:
> >
> > # rm -Rf /tmp/f && mkdir /tmp/f && cp --verbose -t /tmp/f -L
> --preserve=all
> > --parents /etc/apt/sources.list && echo yes ; ls -lR
> > /tmp/f/etc/apt/sources.list /etc/apt/sources.list
> > /etc -> /tmp/f/etc
> > /etc/apt -> /tmp/f/etc/apt
> > '/etc/apt/sources.list' -> '/tmp/f/etc/apt/sources.list'
> > yes
> > -rw-r--r-- 1 root root 263 Mär 26 15:20 /etc/apt/sources.list
> > -rw-r--r-- 1 root root 263 Mär 26 15:20 /tmp/f/etc/apt/sources.list
> > #
> >
> > BTW, I checked also on many other distros that ReaR supports and all
> > distros with cp version 9.1 fail in the same way.
> >
> > Can you please have a look and advise how to proceed? We at the ReaR
> > project can of course change our code to use tar for example, but I won't
> > be surprised if other users will also meet this changed behaviour and
> maybe
> > it is indeed a bug.
>
> Looks like a bug indeed.
> The attached patch should address this in coreutils.
> Any deployments of coreutils 9.1-9.3 inclusive would need to apply this.
>
> thanks,
> Pádraig
>
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#63245
; Package
coreutils
.
(Wed, 03 May 2023 20:06:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 63245 <at> debbugs.gnu.org (full text, mbox):
On 03/05/2023 18:45, Schlomo Schapiro wrote:
> Hi Pádraig,
>
> Wow, nice! That was really quick!
>
> how would this patch get into the affected distros as a bugfix? Then it would actually help me as I can't ship a patched coreutils with ReaR.
I expect the process would be something like:
1. merge this change to upstream coreutils (probably tomorrow).
2. apply this change to debian bookworm
I'd also apply this related patch to bookworm:
https://github.com/coreutils/coreutils/commit/b54da709a.patch
3. propagate those changes to ubuntu lunar
cheers,
Pádraig
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#63245
; Package
coreutils
.
(Thu, 04 May 2023 06:28:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 63245 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi Pádraig,
thank you, that will not yet fix the problem in the older distros? What
about the RPM world with Fedora/RHEL and Archlinux? As far as I can tell
all cp version 9.x are affected by this.
Kind regards,
Schlomo
On Wed, 3 May 2023 at 22:05, Pádraig Brady <P <at> draigbrady.com> wrote:
> On 03/05/2023 18:45, Schlomo Schapiro wrote:
> > Hi Pádraig,
> >
> > Wow, nice! That was really quick!
> >
> > how would this patch get into the affected distros as a bugfix? Then it
> would actually help me as I can't ship a patched coreutils with ReaR.
>
> I expect the process would be something like:
>
> 1. merge this change to upstream coreutils (probably tomorrow).
> 2. apply this change to debian bookworm
> I'd also apply this related patch to bookworm:
> https://github.com/coreutils/coreutils/commit/b54da709a.patch
> 3. propagate those changes to ubuntu lunar
>
> cheers,
> Pádraig
>
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#63245
; Package
coreutils
.
(Thu, 04 May 2023 11:29:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 63245 <at> debbugs.gnu.org (full text, mbox):
On 04/05/2023 07:27, Schlomo Schapiro wrote:
> Hi Pádraig,
>
> thank you, that will not yet fix the problem in the older distros? What
> about the RPM world with Fedora/RHEL and Archlinux? As far as I can tell
> all cp version 9.x are affected by this.
I'll handle the Fedora 37/38 fixes.
RHEL/Centos and current Archlinux are not affected AFAICS.
cheers,
Pádraig
Reply sent
to
Pádraig Brady <P <at> draigBrady.com>
:
You have taken responsibility.
(Thu, 04 May 2023 22:30:03 GMT)
Full text and
rfc822 format available.
Notification sent
to
Schlomo Schapiro <schlomo <at> schapiro.org>
:
bug acknowledged by developer.
(Thu, 04 May 2023 22:30:03 GMT)
Full text and
rfc822 format available.
Message #25 received at 63245-done <at> debbugs.gnu.org (full text, mbox):
On 04/05/2023 12:27, Pádraig Brady wrote:
> On 04/05/2023 07:27, Schlomo Schapiro wrote:
>> Hi Pádraig,
>>
>> thank you, that will not yet fix the problem in the older distros? What
>> about the RPM world with Fedora/RHEL and Archlinux? As far as I can tell
>> all cp version 9.x are affected by this.
>
> I'll handle the Fedora 37/38 fixes.
> RHEL/Centos and current Archlinux are not affected AFAICS.
Fedora 37 and 38 updates are now pending (cc Kamil):
https://bodhi.fedoraproject.org/updates/FEDORA-2023-65365355b3
https://bodhi.fedoraproject.org/updates/FEDORA-2023-4beb422aac
The Fedora patches should also apply to the debian bookworm package,
so I've opened bugs accordingly at:
https://bugs.debian.org/1035530
https://bugs.debian.org/1035531
Schlomo, the second one is the one you're particularly interested in.
Marking this bug as completed upstream.
cheers,
Pádraig
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#63245
; Package
coreutils
.
(Fri, 05 May 2023 01:41:01 GMT)
Full text and
rfc822 format available.
Message #28 received at 63245-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Pádraig Brady <P <at> draigBrady.com> writes:
> On 04/05/2023 12:27, Pádraig Brady wrote:
>> On 04/05/2023 07:27, Schlomo Schapiro wrote:
>>> Hi Pádraig,
>>>
>>> thank you, that will not yet fix the problem in the older distros? What
>>> about the RPM world with Fedora/RHEL and Archlinux? As far as I can tell
>>> all cp version 9.x are affected by this.
>> I'll handle the Fedora 37/38 fixes.
>> RHEL/Centos and current Archlinux are not affected AFAICS.
>
> Fedora 37 and 38 updates are now pending (cc Kamil):
> https://bodhi.fedoraproject.org/updates/FEDORA-2023-65365355b3
> https://bodhi.fedoraproject.org/updates/FEDORA-2023-4beb422aac
>
> The Fedora patches should also apply to the debian bookworm package,
> so I've opened bugs accordingly at:
>
> https://bugs.debian.org/1035530
> https://bugs.debian.org/1035531
>
> Schlomo, the second one is the one you're particularly interested in.
This is relevant to coreutils-9.3, right? In that case, the only way
I found out Gentoo was affected was by reading bug-coreutils by chance.
It's not feasible for all package maintainers to read all bug trackers
regularly for all software in their distributions.
If it's worth filing bug reports in each distro for, it's either worth
a new release, or at least an email to the distributions <at> lists.linux.dev
mailing list.
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#63245
; Package
coreutils
.
(Fri, 05 May 2023 01:42:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#63245
; Package
coreutils
.
(Fri, 05 May 2023 06:38:03 GMT)
Full text and
rfc822 format available.
Message #34 received at 63245-done <at> debbugs.gnu.org (full text, mbox):
On Friday, May 5, 2023 12:29:16 AM CEST Pádraig Brady wrote:
> On 04/05/2023 12:27, Pádraig Brady wrote:
> > On 04/05/2023 07:27, Schlomo Schapiro wrote:
> >> Hi Pádraig,
> >>
> >> thank you, that will not yet fix the problem in the older distros? What
> >> about the RPM world with Fedora/RHEL and Archlinux? As far as I can tell
> >> all cp version 9.x are affected by this.
> >
> > I'll handle the Fedora 37/38 fixes.
> > RHEL/Centos and current Archlinux are not affected AFAICS.
>
> Fedora 37 and 38 updates are now pending (cc Kamil):
> https://bodhi.fedoraproject.org/updates/FEDORA-2023-65365355b3
> https://bodhi.fedoraproject.org/updates/FEDORA-2023-4beb422aac
Thank you for taking care of it, Pádraig!
Kamil
> The Fedora patches should also apply to the debian bookworm package,
> so I've opened bugs accordingly at:
>
> https://bugs.debian.org/1035530
> https://bugs.debian.org/1035531
>
> Schlomo, the second one is the one you're particularly interested in.
>
> Marking this bug as completed upstream.
>
> cheers,
> Pádraig
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#63245
; Package
coreutils
.
(Fri, 05 May 2023 08:46:02 GMT)
Full text and
rfc822 format available.
Message #37 received at 63245-done <at> debbugs.gnu.org (full text, mbox):
On 05/05/2023 02:39, Sam James wrote:
>
> Pádraig Brady <P <at> draigBrady.com> writes:
>
>> On 04/05/2023 12:27, Pádraig Brady wrote:
>>> On 04/05/2023 07:27, Schlomo Schapiro wrote:
>>>> Hi Pádraig,
>>>>
>>>> thank you, that will not yet fix the problem in the older distros? What
>>>> about the RPM world with Fedora/RHEL and Archlinux? As far as I can tell
>>>> all cp version 9.x are affected by this.
>>> I'll handle the Fedora 37/38 fixes.
>>> RHEL/Centos and current Archlinux are not affected AFAICS.
>>
>> Fedora 37 and 38 updates are now pending (cc Kamil):
>> https://bodhi.fedoraproject.org/updates/FEDORA-2023-65365355b3
>> https://bodhi.fedoraproject.org/updates/FEDORA-2023-4beb422aac
>>
>> The Fedora patches should also apply to the debian bookworm package,
>> so I've opened bugs accordingly at:
>>
>> https://bugs.debian.org/1035530
>> https://bugs.debian.org/1035531
>>
>> Schlomo, the second one is the one you're particularly interested in.
>
> This is relevant to coreutils-9.3, right?
Right. Specifically only this bug applies to 9.3. I.e.:
https://github.com/coreutils/coreutils/commit/c6b1fe434
> In that case, the only way
> I found out Gentoo was affected was by reading bug-coreutils by chance.
>
> It's not feasible for all package maintainers to read all bug trackers
> regularly for all software in their distributions.
>
> If it's worth filing bug reports in each distro for, it's either worth
> a new release
Right. I didn't inform distros that generally go with the latest coreutils
(including Fedora rawhide), as I was planning to do a 9.4 release soonish
to address this (and other bugs), and so it would get picked up automatically.
> or at least an email to the distributions <at> lists.linux.dev mailing list.
TIL
thanks!
Pádraig
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#63245
; Package
coreutils
.
(Fri, 05 May 2023 18:11:02 GMT)
Full text and
rfc822 format available.
Message #40 received at 63245 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 2023-05-03 09:39, Pádraig Brady wrote:
> The attached patch should address this in coreutils.
Thanks for fixing that. This area of the code is confusing, and I
attempted to simplify/clarify slightly by installing the attached
cleanup patch. This shouldn't affect behavior.
[0001-cp-p-parents-minor-cleanup-of-previous-patch.patch (text/x-patch, attachment)]
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#63245
; Package
coreutils
.
(Wed, 10 May 2023 21:49:02 GMT)
Full text and
rfc822 format available.
Message #43 received at 63245-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Pádraig Brady <P <at> draigBrady.com> writes:
> On 05/05/2023 02:39, Sam James wrote:
>> Pádraig Brady <P <at> draigBrady.com> writes:
>>
>>> On 04/05/2023 12:27, Pádraig Brady wrote:
>>>> On 04/05/2023 07:27, Schlomo Schapiro wrote:
>>>>> Hi Pádraig,
>>>>>
>>>>> thank you, that will not yet fix the problem in the older distros? What
>>>>> about the RPM world with Fedora/RHEL and Archlinux? As far as I can tell
>>>>> all cp version 9.x are affected by this.
>>>> I'll handle the Fedora 37/38 fixes.
>>>> RHEL/Centos and current Archlinux are not affected AFAICS.
>>>
>>> Fedora 37 and 38 updates are now pending (cc Kamil):
>>> https://bodhi.fedoraproject.org/updates/FEDORA-2023-65365355b3
>>> https://bodhi.fedoraproject.org/updates/FEDORA-2023-4beb422aac
>>>
>>> The Fedora patches should also apply to the debian bookworm package,
>>> so I've opened bugs accordingly at:
>>>
>>> https://bugs.debian.org/1035530
>>> https://bugs.debian.org/1035531
>>>
>>> Schlomo, the second one is the one you're particularly interested in.
>> This is relevant to coreutils-9.3, right?
>
> Right. Specifically only this bug applies to 9.3. I.e.:
> https://github.com/coreutils/coreutils/commit/c6b1fe434
>
>> In that case, the only way
>> I found out Gentoo was affected was by reading bug-coreutils by chance.
>> It's not feasible for all package maintainers to read all bug
>> trackers
>> regularly for all software in their distributions.
>> If it's worth filing bug reports in each distro for, it's either
>> worth
>> a new release
> Right. I didn't inform distros that generally go with the latest coreutils
> (including Fedora rawhide), as I was planning to do a 9.4 release soonish
> to address this (and other bugs), and so it would get picked up automatically.
>
That works too, thank you very much! :)
>> or at least an email to the distributions <at> lists.linux.dev mailing list.
>
> TIL
>
best,
sam
[signature.asc (application/pgp-signature, inline)]
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 08 Jun 2023 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 335 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.