GNU bug report logs - #32342
[PATCH] Do not store mtime when compressing stdin

Previous Next

Package: gzip;

Reported by: "Bernhard M. Wiedemann" <bwiedemann <at> suse.de>

Date: Wed, 1 Aug 2018 11:53:02 UTC

Severity: normal

Tags: patch

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

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Bernhard M. Wiedemann" <bwiedemann <at> suse.de>
To: bug-gzip <at> gnu.org
Cc: "Bernhard M. Wiedemann" <bwiedemann <at> suse.de>
Subject: [PATCH] Do not store mtime when compressing stdin
Date: Wed,  1 Aug 2018 13:51:40 +0200
This allows for reproducible output of
echo foo | gzip | md5sum
tar -cz -H ustar SOMEFILE | md5sum

See https://reproducible-builds.org/ for why this is good.
---
 gzip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gzip.c b/gzip.c
index a023d81..4b00e42 100644
--- a/gzip.c
+++ b/gzip.c
@@ -767,7 +767,7 @@ local void treat_stdin()
       {
         if (S_ISREG (istat.st_mode))
           time_stamp = get_stat_mtime (&istat);
-        else
+        else if (decompress)
           gettime (&time_stamp);
       }
 
-- 
2.16.4





This bug report was last modified 6 years and 344 days ago.

Previous Next


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