GNU bug report logs - #73865
cp 9.1+ fails to overwrite existing files even with -f under Cygwin

Previous Next

Package: coreutils;

Reported by: Brian.Inglis <at> SystematicSW.ab.ca

Date: Fri, 18 Oct 2024 16:48:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Brian.Inglis <at> SystematicSW.ab.ca
To: Paul Eggert <eggert <at> cs.ucla.edu>, 73865 <at> debbugs.gnu.org
Cc: Eric Blake <eblake <at> redhat.com>
Subject: bug#73865: cp 9.1+ fails to overwrite existing files even with -f under Cygwin
Date: Tue, 29 Oct 2024 12:42:45 -0600
On 2024-10-18 11:32, Paul Eggert wrote:
> On 2024-10-18 09:47, Brian Inglis wrote:
>> Hi folks,
>>
>> Versions of coreutils cp from 9.1-9.5 have been failing with error message:
>>
>>      "cp: cannot create regular file '/tmp/b/c': File exists"
>>
>> to overwrite existing files even with -f under Cygwin.
> 
> What does strace say?

Thanks Paul,

That made me think to redo and reread the straces and I noticed that the 
basename was being accessed in the builddir, as patches were now accessing the 
basename not the realpath, so mea culpa!

That required a bunch of rebasing patches, and that now appears to work.

However, I now appear to have the issue that the Cygwin emulated "root" is not 
being detected and handled properly, so during tests, chgrp/chown/chmod 
--preserve-root is being ignored, also presumably rm!, tests are taking forever, 
and all my account and CI system mount points are being trashed by the tests, 
and build/gt-preserve-root.sh.XKPb/out is over 1GB!

I take it that should go into a different bug report, as I need to understand 
whether any access to "root" is just warned and skipped, or the command is 
terminated with prejudice.

The info docs section "Treating ‘/’ specially" appears to be ambiguous about the 
ch??? commands, whereas the man pages say "fail to operate recursively on ’/’".

Cygwin would probably want to default these commands to --preserve-root like rm, 
and also require -f --force to override, but ch??? redefine -f to --silent --quiet!

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                -- Antoine de Saint-Exupéry




This bug report was last modified 264 days ago.

Previous Next


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