GNU bug report logs - #50097
gzip: add "--keep" option to keep original files unchanged

Previous Next

Package: gzip;

Reported by: Krzysztof Żelechowski <giecrilj <at> stegny.2a.pl>

Date: Tue, 17 Aug 2021 17:45:01 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Krzysztof Żelechowski <giecrilj <at> stegny.2a.pl>
Cc: Rodrigo Campos <rodrigo <at> sdfg.com.ar>, 50097 <at> debbugs.gnu.org, Antonio Diaz Diaz <antonio <at> gnu.org>
Subject: bug#50097: gzip: add "--keep" option to keep original files unchanged
Date: Fri, 20 Aug 2021 07:42:54 -0700
On 8/20/21 5:20 AM, Krzysztof Żelechowski wrote:
>> gzip -k b && gzip -cd b.gz >b
>>
>> which would trash the hard-linked file as well.
> That would replace the content of the file b with the content of the file b.
> How bad can that be? ;-)

It could be a problem as-is if some other file reads 'a' in the middle 
of the process. And the problem would be more serious in other examples, 
such as:

echo hello >a
ln a b
gzip -k b && gzip -cd b.gz >>b

This would trash 'a' if gzip -k succeeded. (Same with 'ln -s'.)

>> > Of course one can use -f to go ahead and compress anyway.
> 
> That would silently replace an existing target, which is bad.

Sure. The only question here is what things "gzip -k" should be able to 
do, without the things being considered "bad".

Perhaps if you gave us the surrounding context; that might help explain 
why it would be useful to change the behavior of gzip -k on links. Bug 
report 50097 seems to start up in the middle of a conversation that I'm 
not privy to.




This bug report was last modified 3 years and 78 days ago.

Previous Next


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