Subject: Re: gzip warning about > 4GB breaks amanda
To: Mike M. Volokhov <mishka@apk.od.ua>
From: Greg Troxel <gdt@ir.bbn.com>
List: current-users
Date: 11/18/2005 10:14:30
Thanks for the PR pointers.

With the patch I posted, amanda saved the gzipped dump on tape, but
gave me 'strange' output, similar to the report in PR 31346 (complete
with erroneously including errno text; I should have used warnx rather
than warn).

Christian Biere points out that RFC1952 is unambiguous.  It specifies
that the ISIZE is the input size modulo 2^32.  Thus our gzip simply
follows the standard.  I concur with Christian that there should not
be a warning, and with Hauke Fath that the warning produces extraneous
(and harmful) amanda output.

So, here's a new proposed patch, which prints an improved warning
text only in verbose mode.  Plus, it removes the entire message from
SMALL.

Index: gzip.c
===================================================================
RCS file: /cvsroot/src/usr.bin/gzip/gzip.c,v
retrieving revision 1.77
diff -u -r1.77 gzip.c
--- gzip.c	20 Sep 2005 05:12:15 -0000	1.77
+++ gzip.c	18 Nov 2005 15:10:20 -0000
@@ -639,8 +639,16 @@
 		 (int)(in_tot >> 24) & 0xff);
 	if (i != 8)
 		maybe_err("snprintf");
-	if (in_tot > 0xffffffff)
-		maybe_warn("input file size >= 4GB cannot be saved");
+#ifndef SMALL
+	if (in_tot > 0xffffffff && vflag)
+		/*
+		 * RFC1952 specifies that ISIZE is modulo 2^32, so
+		 * don't note this unless in verbose mode.  (Note that
+		 * amanda reports any such output, which is
+		 * distracting and therefore harmful.)
+		 */
+		warnx("input file size >= 4GB stored modulo 2^32");
+#endif
 	if (write(out, outbufp, i) != i) {
 		maybe_warn("write");
 		in_tot = -1;

  


-- 
        Greg Troxel <gdt@ir.bbn.com>