Debian Bug report logs - #177942
gzip: gzip -cf refusing to compress devices

version graph

Package: gzip; Maintainer for gzip is Bdale Garbee <bdale@gag.com>; Source for gzip is src:gzip.

Reported by: Martin Mares <mj@ucw.cz>

Date: Wed, 22 Jan 2003 19:48:02 UTC

Severity: normal

Found in version 1.3.2-3

Fixed in version gzip/1.3.12-1

Done: Bdale Garbee <bdale@gag.com>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Bdale Garbee <bdale@gag.com>, gzip@packages.qa.debian.org:
Bug#177942; Package gzip. Full text and rfc822 format available.

Acknowledgement sent to Martin Mares <mj@ucw.cz>:
New Bug report received and forwarded. Copy sent to Bdale Garbee <bdale@gag.com>, gzip@packages.qa.debian.org. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Martin Mares <mj@ucw.cz>
To: submit@bugs.debian.org
Subject: gzip: gzip -cf refusing to compress devices
Date: Wed, 22 Jan 2003 20:41:07 +0100 (CET)
Package: gzip
Version: 1.3.2-3
Severity: normal

When I try gzip -c /dev/fd0, it tells me that

gzip: /dev/fd0 is not a directory or a regular file - ignored

and even -f (force) doesn't help. Refusing to compress devices
in normal mode is of course useful, but when compression to stdout
is requested, there is no point in giving up.

The patch below fixes the problem.

-- System Information
Debian Release: 3.0
Kernel Version: Linux albireo 2.4.19 #9 Wed Nov 13 21:51:10 CET 2002 i586 unknown

Versions of the packages gzip depends on:
ii  debianutils    1.16           Miscellaneous utilities specific to Debian.
ii  libc6          2.2.5-11.2     GNU C Library: Shared libraries and Timezone


--- gzip.c.mj	Wed Jan 22 20:17:55 2003
+++ gzip.c	Wed Jan 22 20:40:35 2003
@@ -787,7 +787,7 @@
 	WARN((stderr,"%s: %s is a directory -- ignored\n", progname, ifname));
 	return;
     }
-    if (!S_ISREG(istat.st_mode)) {
+    if (!S_ISREG(istat.st_mode) && !to_stdout) {
 	WARN((stderr,
 	      "%s: %s is not a directory or a regular file - ignored\n",
 	      progname, ifname));



Information forwarded to debian-bugs-dist@lists.debian.org, Bdale Garbee <bdale@gag.com>:
Bug#177942; Package gzip. Full text and rfc822 format available.

Acknowledgement sent to Paul Eggert <eggert@CS.UCLA.EDU>:
Extra info received and forwarded to list. Copy sent to Bdale Garbee <bdale@gag.com>. Full text and rfc822 format available.

Message #10 received at 177942@bugs.debian.org (full text, mbox):

From: Paul Eggert <eggert@CS.UCLA.EDU>
To: Martin Mares <mj@ucw.cz>
Cc: 177942@bugs.debian.org, bug-gzip@gnu.org
Subject: Re: gzip: gzip -cf refusing to compress devices
Date: Sat, 23 Dec 2006 21:53:10 -0800
Thanks for reporting that problem.  The full fix is a bit trickier
than I'd like, but I've installed the following into the gzip CVS
sources.

2006-12-23  Paul Eggert  <eggert@cs.ucla.edu>

	* NEWS: Fix bug reported by Martin Mares in
	<http://bugs.debian.org/177942>.
	* gzip.c (treat_stdin): Remove NO_STDIN_FSTAT and NO_PIPE_TIMESTAMP
	stuff.  It didn't work (led to syntax errors) and was confusing.
	Report an error if stdin cannot be statted even if !list && no_time.
	Get stdin's size if it is regular.
	(treat_file): Do not report an error with setuid, setgid,
	sticky, or non-regular, non-directory files if to_stdout.
	Allow 'force' to override the caution about sticky files.
	Use the same form for time stamps that treat_stdin uses.

--- NEWS	24 Dec 2006 05:25:19 -0000	1.11
+++ NEWS	24 Dec 2006 05:45:05 -0000
@@ -2,6 +2,9 @@ Gzip 1.3.10 (200?-??-??)

 * zcmp and zdiff did not work in the usual case, due to a typo.

+* gzip -c and zcat now work on special files, files with special mode bits,
+  and files with multiple hard links.
+
 Gzip 1.3.9 (2006-12-15)

 * No major changes; only porting fixes.
--- gzip.c	12 Dec 2006 00:03:17 -0000	1.11
+++ gzip.c	24 Dec 2006 05:45:05 -0000
@@ -616,22 +616,16 @@ local void treat_stdin()
     strcpy(ifname, "stdin");
     strcpy(ofname, "stdout");

-    /* Get the time stamp on the input file. */
-    time_stamp.tv_nsec = -1;  /* The time is unknown by default.  */
-
-#ifndef NO_STDIN_FSTAT
-    if (list || !no_time) {
-	if (fstat(fileno(stdin), &istat) != 0) {
-	    progerror("standard input");
-	    do_exit(ERROR);
-	}
-# ifdef NO_PIPE_TIMESTAMP
-	if (S_ISREG(istat.st_mode))
-# endif
-	    time_stamp = get_stat_mtime (&istat);
-#endif /* NO_STDIN_FSTAT */
-    }
-    ifile_size = -1L; /* convention for unknown size */
+    /* Get the file's time stamp and size.  */
+    if (fstat (fileno (stdin), &istat) != 0)
+      {
+	progerror ("standard input");
+	do_exit (ERROR);
+      }
+    ifile_size = S_ISREG (istat.st_mode) ? istat.st_size : -1;
+    time_stamp.tv_nsec = -1;
+    if (!no_time || list)
+      time_stamp = get_stat_mtime (&istat);

     clear_bufs(); /* clear input and output buffers */
     to_stdout = 1;
@@ -710,48 +704,57 @@ local void treat_file(iname)
 	       program_name, ifname));
 	return;
     }
-    if (!S_ISREG(istat.st_mode)) {
-	WARN((stderr,
-	      "%s: %s is not a directory or a regular file - ignored\n",
-	      program_name, ifname));
-	close (ifd);
-	return;
-    }

-    if (istat.st_mode & S_ISUID)
+    if (! to_stdout)
       {
-	WARN ((stderr, "%s: %s is set-user-ID on execution - ignored\n",
-	       program_name, ifname));
-	close (ifd);
-	return;
-      }
-    if (istat.st_mode & S_ISGID)
-      {
-	WARN ((stderr, "%s: %s is set-group-ID on execution - ignored\n",
-	       program_name, ifname));
-	close (ifd);
-	return;
-      }
-    if (istat.st_mode & S_ISVTX)
-      {
-	WARN ((stderr, "%s: %s has the sticky bit set - file ignored\n",
-	       program_name, ifname));
-	close (ifd);
-	return;
-      }
+	if (! S_ISREG (istat.st_mode))
+	  {
+	    WARN ((stderr,
+		   "%s: %s is not a directory or a regular file - ignored\n",
+		   program_name, ifname));
+	    close (ifd);
+	    return;
+	  }
+	if (istat.st_mode & S_ISUID)
+	  {
+	    WARN ((stderr, "%s: %s is set-user-ID on execution - ignored\n",
+		   program_name, ifname));
+	    close (ifd);
+	    return;
+	  }
+	if (istat.st_mode & S_ISGID)
+	  {
+	    WARN ((stderr, "%s: %s is set-group-ID on execution - ignored\n",
+		   program_name, ifname));
+	    close (ifd);
+	    return;
+	  }

-    if (istat.st_nlink > 1 && !to_stdout && !force) {
-	WARN((stderr, "%s: %s has %lu other link%c -- unchanged\n",
-	      program_name, ifname, (unsigned long) istat.st_nlink - 1,
-	      istat.st_nlink > 2 ? 's' : ' '));
-	close (ifd);
-	return;
-    }
+	if (! force)
+	  {
+	    if (istat.st_mode & S_ISVTX)
+	      {
+		WARN ((stderr,
+		       "%s: %s has the sticky bit set - file ignored\n",
+		       program_name, ifname));
+		close (ifd);
+		return;
+	      }
+	    if (2 <= istat.st_nlink)
+	      {
+		WARN ((stderr, "%s: %s has %lu other link%c -- unchanged\n",
+		       program_name, ifname,
+		       (unsigned long int) istat.st_nlink - 1,
+		       istat.st_nlink == 2 ? ' ' : 's'));
+		close (ifd);
+		return;
+	      }
+	  }
+      }

-    ifile_size = istat.st_size;
-    if (no_time && !list)
-      time_stamp.tv_nsec = -1;
-    else
+    ifile_size = S_ISREG (istat.st_mode) ? istat.st_size : -1;
+    time_stamp.tv_nsec = -1;
+    if (!no_time || list)
       time_stamp = get_stat_mtime (&istat);

     /* Generate output file name. For -r and (-t or -l), skip files



Reply sent to Bdale Garbee <bdale@gag.com>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Martin Mares <mj@ucw.cz>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #15 received at 177942-close@bugs.debian.org (full text, mbox):

From: Bdale Garbee <bdale@gag.com>
To: 177942-close@bugs.debian.org
Subject: Bug#177942: fixed in gzip 1.3.12-1
Date: Wed, 13 Jun 2007 23:02:05 +0000
Source: gzip
Source-Version: 1.3.12-1

We believe that the bug you reported is fixed in the latest version of
gzip, which is due to be installed in the Debian FTP archive:

gzip_1.3.12-1.diff.gz
  to pool/main/g/gzip/gzip_1.3.12-1.diff.gz
gzip_1.3.12-1.dsc
  to pool/main/g/gzip/gzip_1.3.12-1.dsc
gzip_1.3.12-1_i386.deb
  to pool/main/g/gzip/gzip_1.3.12-1_i386.deb
gzip_1.3.12.orig.tar.gz
  to pool/main/g/gzip/gzip_1.3.12.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 177942@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Bdale Garbee <bdale@gag.com> (supplier of updated gzip package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Wed, 13 Jun 2007 18:55:42 -0400
Source: gzip
Binary: gzip
Architecture: source i386
Version: 1.3.12-1
Distribution: unstable
Urgency: low
Maintainer: Bdale Garbee <bdale@gag.com>
Changed-By: Bdale Garbee <bdale@gag.com>
Description: 
 gzip       - The GNU compression utility
Closes: 177942 225864 362786 366660 367400 383358 402042 404062 404099 404114 419895
Changes: 
 gzip (1.3.12-1) unstable; urgency=low
 .
   * new upstream version, closes: #177942, #225864, #362786, #366660, #367400,
     #383358, #402042, #404099, #404114, #419895
   * fix delivery of upstream ChangeLog, closes: #404062
Files: 
 d33a83601c01806bf7117e92ad49cf94 553 utils required gzip_1.3.12-1.dsc
 b5bac2d21840ae077e0217bc5e4845b1 462169 utils required gzip_1.3.12.orig.tar.gz
 ee3961eed29e786f60c13533b0836cf0 11721 utils required gzip_1.3.12-1.diff.gz
 b99c1f2c598ee0ab2a3bedbc0674ec63 101672 utils required gzip_1.3.12-1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGcHZKZKfAp/LPAagRAp1hAJ9RoVn9dZDF1ma/+wiolZjixO46sQCeIdX+
yca5Z77H6gKKoLCCGfFHjKk=
=BHHf
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 13 Jul 2007 07:46:37 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 16:16:00 2014; Machine Name: buxtehude.debian.org

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