From c9760d4dc561dc1c99f0fb3f3535712cd155b1ac Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 31 2019 10:03:58 +0000 Subject: import gzip-1.5-10.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8772b02 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/gzip-1.5.tar.xz diff --git a/.gzip.metadata b/.gzip.metadata new file mode 100644 index 0000000..bcce77a --- /dev/null +++ b/.gzip.metadata @@ -0,0 +1 @@ +473aaac6a48445221fd5b03fde52f0236c7486ab SOURCES/gzip-1.5.tar.xz diff --git a/SOURCES/gzip-1.3.12-openbsd-owl-tmp.patch b/SOURCES/gzip-1.3.12-openbsd-owl-tmp.patch new file mode 100644 index 0000000..423c667 --- /dev/null +++ b/SOURCES/gzip-1.3.12-openbsd-owl-tmp.patch @@ -0,0 +1,45 @@ +--- gzip-1.3.12/znew.in.owl-tmp 2007-06-04 09:15:11.000000000 +0200 ++++ gzip-1.3.12/znew.in 2007-06-04 09:23:18.000000000 +0200 +@@ -55,28 +55,27 @@ + # block is the disk block size (best guess, need not be exact) + + warn="(does not preserve modes and timestamp)" +-tmp=${TMPDIR-/tmp}/zfoo.$$ +-set -C +-echo hi > $tmp || exit +-if test -z "`(${CPMOD-cpmod} $tmp $tmp) 2>&1`"; then +- cpmod=${CPMOD-cpmod} ++cpmod= ++cpmodarg= ++if type ${CPMOD:-cpmod} 2>/dev/null; then ++ cpmod=${CPMOD:-cpmod} + warn="" + fi + +-if test -z "$cpmod" && ${TOUCH-touch} -r $tmp $tmp 2>/dev/null; then +- cpmod="${TOUCH-touch}" ++if test -z "$cpmod"; then ++ cpmod=touch + cpmodarg="-r" + warn="(does not preserve file modes)" + fi + +-# check if GZIP env. variable uses -S or --suffix +-gzip -q $tmp +-ext=`echo $tmp* | sed "s|$tmp||"` +-rm -f $tmp* +-if test -z "$ext"; then +- echo znew: error determining gzip extension +- exit 1 +-fi ++case "$GZIP" in ++ *-S*) ext=`echo "$GZIP" | sed 's/^.*-S[[:space:]]*\([^[:space:]]*\).*$/\1/'` ++ ;; ++ *-suffix*) ext=`echo "$GZIP" | sed 's/^.*--suffix=\([^[:space:]]*\).*$/\1/'` ++ ;; ++ *) ext='.gz' ++ ;; ++esac + if test "$ext" = ".Z"; then + echo znew: cannot use .Z as gzip extension. + exit 1 diff --git a/SOURCES/gzip-1.3.13-cve-2006-4337.patch b/SOURCES/gzip-1.3.13-cve-2006-4337.patch new file mode 100644 index 0000000..5855d2b --- /dev/null +++ b/SOURCES/gzip-1.3.13-cve-2006-4337.patch @@ -0,0 +1,118 @@ +--- gzip-1.3.9/unlzh.c.4337 2007-01-15 16:31:53.000000000 +0100 ++++ gzip-1.3.9/unlzh.c 2007-01-15 16:38:08.000000000 +0100 +@@ -146,8 +146,8 @@ + start[1] = 0; + for (i = 1; i <= 16; i++) + start[i + 1] = start[i] + (count[i] << (16 - i)); +- if ((start[17] & 0xffff) != 0) +- gzip_error ("Bad table\n"); ++ if ((start[17] & 0xffff) != 0 || tablebits > 16) /* 16 for weight below */ ++ gzip_error ("Bad table (case b)\n"); + + jutbits = 16 - tablebits; + for (i = 1; i <= (unsigned)tablebits; i++) { +@@ -161,15 +162,15 @@ + + i = start[tablebits + 1] >> jutbits; + if (i != 0) { +- k = 1 << tablebits; +- while (i != k) table[i++] = 0; ++ k = MIN(1 << tablebits, DIST_BUFSIZE); ++ while (i < k) table[i++] = 0; + } + + avail = nchar; + mask = (unsigned) 1 << (15 - tablebits); + for (ch = 0; ch < (unsigned)nchar; ch++) { + if ((len = bitlen[ch]) == 0) continue; +- nextcode = start[len] + weight[len]; ++ nextcode = MIN(start[len] + weight[len], DIST_BUFSIZE); + if (len <= (unsigned)tablebits) { + if ((unsigned) 1 << tablebits < nextcode) + gzip_error ("Bad table\n"); +@@ -212,7 +213,7 @@ + for (i = 0; i < 256; i++) pt_table[i] = c; + } else { + i = 0; +- while (i < n) { ++ while (i < MIN(n,NPT)) { + c = bitbuf >> (BITBUFSIZ - 3); + if (c == 7) { + mask = (unsigned) 1 << (BITBUFSIZ - 1 - 3); +@@ -224,7 +225,7 @@ + pt_len[i++] = c; + if (i == i_special) { + c = getbits(2); +- while (--c >= 0) pt_len[i++] = 0; ++ while (--c >= 0 && i < NPT) pt_len[i++] = 0; + } + } + while (i < nn) pt_len[i++] = 0; +@@ -244,7 +245,7 @@ + for (i = 0; i < 4096; i++) c_table[i] = c; + } else { + i = 0; +- while (i < n) { ++ while (i < MIN(n,NC)) { + c = pt_table[bitbuf >> (BITBUFSIZ - 8)]; + if (c >= NT) { + mask = (unsigned) 1 << (BITBUFSIZ - 1 - 8); +@@ -259,7 +260,7 @@ + if (c == 0) c = 1; + else if (c == 1) c = getbits(4) + 3; + else c = getbits(CBIT) + 20; +- while (--c >= 0) c_len[i++] = 0; ++ while (--c >= 0 && i < NC) c_len[i++] = 0; + } else c_len[i++] = c - 2; + } + while (i < NC) c_len[i++] = 0; +@@ -352,7 +353,7 @@ + while (--j >= 0) { + buffer[r] = buffer[i]; + i = (i + 1) & (DICSIZ - 1); +- if (++r == count) return r; ++ if (++r >= count) return r; + } + for ( ; ; ) { + c = decode_c(); +@@ -362,14 +363,14 @@ + } + if (c <= UCHAR_MAX) { + buffer[r] = c; +- if (++r == count) return r; ++ if (++r >= count) return r; + } else { + j = c - (UCHAR_MAX + 1 - THRESHOLD); + i = (r - decode_p() - 1) & (DICSIZ - 1); + while (--j >= 0) { + buffer[r] = buffer[i]; + i = (i + 1) & (DICSIZ - 1); +- if (++r == count) return r; ++ if (++r >= count) return r; + } + } + } +--- gzip-1.3.9/gzip.h.4337 2007-01-15 16:31:53.000000000 +0100 ++++ gzip-1.3.9/gzip.h 2007-01-15 16:38:52.000000000 +0100 +@@ -224,6 +224,8 @@ + #define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf(0)) + #define try_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf(1)) + ++#define MIN(a,b) ((a) <= (b) ? (a) : (b)) ++ + /* put_byte is used for the compressed output, put_ubyte for the + * uncompressed output. However unlzw() uses window for its + * suffix table instead of its output buffer, so it does not use put_ubyte +--- gzip-1.3.9/unpack.c.4337 2007-01-15 16:31:53.000000000 +0100 ++++ gzip-1.3.9/unpack.c 2007-01-15 16:39:12.000000000 +0100 +@@ -21,9 +21,6 @@ + #include "tailor.h" + #include "gzip.h" + +-#define MIN(a,b) ((a) <= (b) ? (a) : (b)) +-/* The arguments must not have side effects. */ +- + #define MAX_BITLEN 25 + /* Maximum length of Huffman codes. (Minor modifications to the code + * would be needed to support 32 bits codes, but pack never generates + diff --git a/SOURCES/gzip-1.3.13-rsync.patch b/SOURCES/gzip-1.3.13-rsync.patch new file mode 100644 index 0000000..ab36230 --- /dev/null +++ b/SOURCES/gzip-1.3.13-rsync.patch @@ -0,0 +1,288 @@ +Index: gzip-1.5/deflate.c +=================================================================== +--- gzip-1.5.orig/deflate.c ++++ gzip-1.5/deflate.c +@@ -131,6 +131,14 @@ + #endif + /* Matches of length 3 are discarded if their distance exceeds TOO_FAR */ + ++#ifndef RSYNC_WIN ++# define RSYNC_WIN 4096 ++#endif ++/* Size of rsync window, must be < MAX_DIST */ ++ ++#define RSYNC_SUM_MATCH(sum) ((sum) % RSYNC_WIN == 0) ++/* Whether window sum matches magic value */ ++ + /* =========================================================================== + * Local data used by the "longest match" routines. + */ +@@ -212,6 +220,8 @@ local int compr_level; + unsigned good_match; + /* Use a faster search when the previous match is longer than this */ + ++local ulg rsync_sum; /* rolling sum of rsync window */ ++local ulg rsync_chunk_end; /* next rsync sequence point */ + + /* Values for max_lazy_match, good_match and max_chain_length, depending on + * the desired pack level (0..9). The values given below have been tuned to +@@ -314,6 +324,10 @@ void lm_init (pack_level, flags) + #endif + /* prev will be initialized on the fly */ + ++ /* rsync params */ ++ rsync_chunk_end = 0xFFFFFFFFUL; ++ rsync_sum = 0; ++ + /* Set the default configuration parameters: + */ + max_lazy_match = configuration_table[pack_level].max_lazy; +@@ -550,6 +564,8 @@ local void fill_window() + memcpy((char*)window, (char*)window+WSIZE, (unsigned)WSIZE); + match_start -= WSIZE; + strstart -= WSIZE; /* we now have strstart >= MAX_DIST: */ ++ if (rsync_chunk_end != 0xFFFFFFFFUL) ++ rsync_chunk_end -= WSIZE; + + block_start -= (long) WSIZE; + +@@ -579,13 +595,46 @@ local void fill_window() + } + } + ++local void rsync_roll(start, num) ++ unsigned start; ++ unsigned num; ++{ ++ unsigned i; ++ ++ if (start < RSYNC_WIN) { ++ /* before window fills. */ ++ for (i = start; i < RSYNC_WIN; i++) { ++ if (i == start + num) return; ++ rsync_sum += (ulg)window[i]; ++ } ++ num -= (RSYNC_WIN - start); ++ start = RSYNC_WIN; ++ } ++ ++ /* buffer after window full */ ++ for (i = start; i < start+num; i++) { ++ /* New character in */ ++ rsync_sum += (ulg)window[i]; ++ /* Old character out */ ++ rsync_sum -= (ulg)window[i - RSYNC_WIN]; ++ if (rsync_chunk_end == 0xFFFFFFFFUL && RSYNC_SUM_MATCH(rsync_sum)) ++ rsync_chunk_end = i; ++ } ++} ++ ++/* =========================================================================== ++ * Set rsync_chunk_end if window sum matches magic value. ++ */ ++#define RSYNC_ROLL(s, n) \ ++ do { if (rsync) rsync_roll((s), (n)); } while(0) ++ + /* =========================================================================== + * Flush the current block, with given end-of-file flag. + * IN assertion: strstart is set to the end of the current match. + */ + #define FLUSH_BLOCK(eof) \ + flush_block(block_start >= 0L ? (char*)&window[(unsigned)block_start] : \ +- (char*)NULL, (long)strstart - block_start, (eof)) ++ (char*)NULL, (long)strstart - block_start, flush-1, (eof)) + + /* =========================================================================== + * Processes a new input file and return its compressed length. This +@@ -596,7 +645,7 @@ local void fill_window() + local off_t deflate_fast() + { + IPos hash_head; /* head of the hash chain */ +- int flush; /* set if current block must be flushed */ ++ int flush; /* set if current block must be flushed, 2=>and padded */ + unsigned match_length = 0; /* length of best match */ + + prev_length = MIN_MATCH-1; +@@ -625,7 +674,8 @@ local off_t deflate_fast() + flush = ct_tally(strstart-match_start, match_length - MIN_MATCH); + + lookahead -= match_length; +- ++ ++ RSYNC_ROLL(strstart, match_length); + /* Insert new strings in the hash table only if the match length + * is not too large. This saves time but degrades compression. + */ +@@ -654,9 +704,14 @@ local off_t deflate_fast() + /* No match, output a literal byte */ + Tracevv((stderr,"%c",window[strstart])); + flush = ct_tally (0, window[strstart]); ++ RSYNC_ROLL(strstart, 1); + lookahead--; + strstart++; + } ++ if (rsync && strstart > rsync_chunk_end) { ++ rsync_chunk_end = 0xFFFFFFFFUL; ++ flush = 2; ++ } + if (flush) FLUSH_BLOCK(0), block_start = strstart; + + /* Make sure that we always have enough lookahead, except +@@ -730,6 +785,7 @@ off_t deflate() + */ + lookahead -= prev_length-1; + prev_length -= 2; ++ RSYNC_ROLL(strstart, prev_length+1); + do { + strstart++; + INSERT_STRING(strstart, hash_head); +@@ -742,24 +798,40 @@ off_t deflate() + match_available = 0; + match_length = MIN_MATCH-1; + strstart++; +- if (flush) FLUSH_BLOCK(0), block_start = strstart; + ++ if (rsync && strstart > rsync_chunk_end) { ++ rsync_chunk_end = 0xFFFFFFFFUL; ++ flush = 2; ++ } ++ if (flush) FLUSH_BLOCK(0), block_start = strstart; + } else if (match_available) { + /* If there was no match at the previous position, output a + * single literal. If there was a match but the current match + * is longer, truncate the previous match to a single literal. + */ + Tracevv((stderr,"%c",window[strstart-1])); +- if (ct_tally (0, window[strstart-1])) { +- FLUSH_BLOCK(0), block_start = strstart; ++ flush = ct_tally (0, window[strstart-1]); ++ if (rsync && strstart > rsync_chunk_end) { ++ rsync_chunk_end = 0xFFFFFFFFUL; ++ flush = 2; + } ++ if (flush) FLUSH_BLOCK(0), block_start = strstart; ++ RSYNC_ROLL(strstart, 1); + strstart++; + lookahead--; + } else { + /* There is no previous match to compare with, wait for + * the next step to decide. + */ ++ if (rsync && strstart > rsync_chunk_end) { ++ /* Reset huffman tree */ ++ rsync_chunk_end = 0xFFFFFFFFUL; ++ flush = 2; ++ FLUSH_BLOCK(0), block_start = strstart; ++ } ++ + match_available = 1; ++ RSYNC_ROLL(strstart, 1); + strstart++; + lookahead--; + } +Index: gzip-1.5/doc/gzip.texi +=================================================================== +--- gzip-1.5.orig/doc/gzip.texi ++++ gzip-1.5/doc/gzip.texi +@@ -353,6 +353,14 @@ specified on the command line are direct + into the directory and compress all the files it finds there (or + decompress them in the case of @command{gunzip}). + ++@item --rsyncable ++While compressing, synchronize the output occasionally based on the ++input. This reduces compression by about 1 percent most cases, but ++means that the @code{rsync} program can take advantage of similarities ++in the uncompressed input when syncronizing two files compressed with ++this flag. @code{gunzip} cannot tell the difference between a ++compressed file created with this option, and one created without it. ++ + @item --suffix @var{suf} + @itemx -S @var{suf} + Use suffix @var{suf} instead of @samp{.gz}. Any suffix can be +Index: gzip-1.5/gzip.c +=================================================================== +--- gzip-1.5.orig/gzip.c ++++ gzip-1.5/gzip.c +@@ -213,6 +213,7 @@ int ofd; /* output fil + unsigned insize; /* valid bytes in inbuf */ + unsigned inptr; /* index of next byte to be processed in inbuf */ + unsigned outcnt; /* bytes in output buffer */ ++int rsync = 0; /* make ryncable chunks */ + + static int handled_sig[] = + { +@@ -270,7 +271,7 @@ static const struct option longopts[] = + {"best", 0, 0, '9'}, /* compress better */ + {"lzw", 0, 0, 'Z'}, /* make output compatible with old compress */ + {"bits", 1, 0, 'b'}, /* max number of bits per code (implies -Z) */ +- ++ {"rsyncable", 0, 0, 'R'}, /* make rsync-friendly archive */ + { 0, 0, 0, 0 } + }; + +@@ -353,6 +354,7 @@ local void help() + " -Z, --lzw produce output compatible with old compress", + " -b, --bits=BITS max number of bits per code (implies -Z)", + #endif ++ " --rsyncable Make rsync-friendly archive", + "", + "With no FILE, or when FILE is -, read standard input.", + "", +@@ -482,6 +484,9 @@ int main (int argc, char **argv) + recursive = 1; + #endif + break; ++ ++ case 'R': ++ rsync = 1; break; + case 'S': + #ifdef NO_MULTIPLE_DOTS + if (*optarg == '.') optarg++; +Index: gzip-1.5/gzip.h +=================================================================== +--- gzip-1.5.orig/gzip.h ++++ gzip-1.5/gzip.h +@@ -140,6 +140,7 @@ EXTERN(uch, window); /* Sliding + extern unsigned insize; /* valid bytes in inbuf */ + extern unsigned inptr; /* index of next byte to be processed in inbuf */ + extern unsigned outcnt; /* bytes in output buffer */ ++extern int rsync; /* deflate into rsyncable chunks */ + + extern off_t bytes_in; /* number of input bytes */ + extern off_t bytes_out; /* number of output bytes */ +@@ -287,7 +288,7 @@ extern off_t deflate (void); + /* in trees.c */ + extern void ct_init (ush *attr, int *method); + extern int ct_tally (int dist, int lc); +-extern off_t flush_block (char *buf, ulg stored_len, int eof); ++extern off_t flush_block (char *buf, ulg stored_len, int pad, int eof); + + /* in bits.c */ + extern void bi_init (file_t zipfile); +Index: gzip-1.5/trees.c +=================================================================== +--- gzip-1.5.orig/trees.c ++++ gzip-1.5/trees.c +@@ -856,9 +856,10 @@ local void send_all_trees(lcodes, dcodes + * trees or store, and output the encoded block to the zip file. This function + * returns the total compressed length for the file so far. + */ +-off_t flush_block(buf, stored_len, eof) ++off_t flush_block(buf, stored_len, pad, eof) + char *buf; /* input block, or NULL if too old */ + ulg stored_len; /* length of input block */ ++ int pad; /* pad output to byte boundary */ + int eof; /* true if this is the last block for a file */ + { + ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ +@@ -951,6 +952,10 @@ off_t flush_block(buf, stored_len, eof) + Assert (input_len == bytes_in, "bad input size"); + bi_windup(); + compressed_len += 7; /* align on byte boundary */ ++ } else if (pad && (compressed_len % 8) != 0) { ++ send_bits((STORED_BLOCK<<1)+eof, 3); /* send block type */ ++ compressed_len = (compressed_len + 3 + 7) & ~7L; ++ copy_block(buf, 0, 1); /* with header */ + } + + return compressed_len >> 3; diff --git a/SOURCES/gzip-1.3.5-cve-2006-4337_len.patch b/SOURCES/gzip-1.3.5-cve-2006-4337_len.patch new file mode 100644 index 0000000..29fe598 --- /dev/null +++ b/SOURCES/gzip-1.3.5-cve-2006-4337_len.patch @@ -0,0 +1,11 @@ +--- gzip-1.3.5/unlzh.c.len 2006-11-22 09:35:10.000000000 +0100 ++++ gzip-1.3.5/unlzh.c 2006-11-22 09:38:52.000000000 +0100 +@@ -189,7 +189,7 @@ + } + *p = ch; + } +- start[len] = nextcode; ++ start[len] = start[len] + weight[len]; + } + } + diff --git a/SOURCES/gzip-1.3.5-cve-2006-4338.patch b/SOURCES/gzip-1.3.5-cve-2006-4338.patch new file mode 100644 index 0000000..82ea61f --- /dev/null +++ b/SOURCES/gzip-1.3.5-cve-2006-4338.patch @@ -0,0 +1,29 @@ +--- gzip-1.3.3/unlzh.c.4338 2006-09-07 10:49:31.000000000 +0200 ++++ gzip-1.3.3/unlzh.c 2006-09-07 11:37:53.000000000 +0200 +@@ -252,7 +252,7 @@ local void read_c_len() + if (bitbuf & mask) c = right[c]; + else c = left [c]; + mask >>= 1; +- } while (c >= NT); ++ } while (c >= NT && (mask || c != left[c])); + } + fillbuf((int) pt_len[c]); + if (c <= 2) { +@@ -288,7 +288,7 @@ local unsigned decode_c() + if (bitbuf & mask) j = right[j]; + else j = left [j]; + mask >>= 1; +- } while (j >= NC); ++ } while (j >= NC && (mask || j != left[j])); + } + fillbuf((int) c_len[j]); + return j; +@@ -305,7 +305,7 @@ local unsigned decode_p() + if (bitbuf & mask) j = right[j]; + else j = left [j]; + mask >>= 1; +- } while (j >= NP); ++ } while (j >= NP && (mask || j != left[j])); + } + fillbuf((int) pt_len[j]); + if (j != 0) j = ((unsigned) 1 << (j - 1)) + getbits((int) (j - 1)); diff --git a/SOURCES/gzip-1.3.5-zforce.patch b/SOURCES/gzip-1.3.5-zforce.patch new file mode 100644 index 0000000..d5d8769 --- /dev/null +++ b/SOURCES/gzip-1.3.5-zforce.patch @@ -0,0 +1,12 @@ +diff -up gzip-1.3.12/zforce.in.zforce gzip-1.3.12/zforce.in +--- gzip-1.3.12/zforce.in.zforce 2007-02-05 21:54:26.000000000 +0100 ++++ gzip-1.3.12/zforce.in 2008-09-01 14:17:26.000000000 +0200 +@@ -58,7 +58,7 @@ for i do + continue + fi + +- if gzip -lv < "$i" 2>/dev/null | grep '^defl' > /dev/null; then ++ if gzip -l < "$i" 2>/dev/null | grep '^\s\+compressed' > /dev/null; then + + new="$i.gz" + if mv "$i" "$new"; then diff --git a/SOURCES/gzip-1.3.9-addsuffix.patch b/SOURCES/gzip-1.3.9-addsuffix.patch new file mode 100644 index 0000000..80a823d --- /dev/null +++ b/SOURCES/gzip-1.3.9-addsuffix.patch @@ -0,0 +1,19 @@ +--- gzip-1.3.9/zmore.in.pom 2007-01-15 15:31:26.000000000 +0100 ++++ gzip-1.3.9/zmore.in 2007-01-15 15:34:06.000000000 +0100 +@@ -70,7 +70,7 @@ + --v*) exec echo "$version";; + esac + +- < "$FILE" || continue ++ if test -e $FILE || test -e $FILE.gz; then + if test $FIRST -eq 0; then + echo $n1 "--More--(Next file: $FILE)$n2" + stty $cb -echo 2>/dev/null +@@ -88,5 +88,7 @@ + if test -t 1; then + FIRST=0 + fi ++ else < $FILE ++ fi + done + fi diff --git a/SOURCES/gzip-1.5-missing-grep-options-part1.patch b/SOURCES/gzip-1.5-missing-grep-options-part1.patch new file mode 100644 index 0000000..8a3991f --- /dev/null +++ b/SOURCES/gzip-1.5-missing-grep-options-part1.patch @@ -0,0 +1,31 @@ +From c423935181a9a92beadb247747f0bcab2c597e20 Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Wed, 12 Jun 2013 11:42:34 -0700 +Subject: zgrep: usage should say which grep options are not supported + +* zgrep.in (usage): Document which grep options are not supported. +Problem reported by Liron Paryente in +. +--- + zgrep.in | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/zgrep.in b/zgrep.in +index 154d17f..c149577 100644 +--- a/zgrep.in ++++ b/zgrep.in +@@ -42,7 +42,10 @@ usage="Usage: $0 [OPTION]... [-e] PATTERN [FILE]... + Look for instances of PATTERN in the input FILEs, using their + uncompressed contents if they are compressed. + +-OPTIONs are the same as for 'grep'. ++OPTIONs are the same as for 'grep', except that the following 'grep' ++options are not supported: --dereference-recursive (-R), --directories (-d), ++--exclude, --exclude-from, --exclude-dir, --include, --null (-Z), ++--null-data (-z), and --recursive (-r). + + Report bugs to ." + +-- +cgit v1.0-41-gc330 + diff --git a/SOURCES/gzip-1.5-missing-grep-options-part2.patch b/SOURCES/gzip-1.5-missing-grep-options-part2.patch new file mode 100644 index 0000000..4729e19 --- /dev/null +++ b/SOURCES/gzip-1.5-missing-grep-options-part2.patch @@ -0,0 +1,48 @@ +From a2c82475de5fb39e5e36586e664f7940e7daf48f Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Tue, 11 Jun 2013 19:43:21 -0700 +Subject: doc: zgrep exit status, unsupported options + +* zgrep.1 (EXIT STATUS, BUGS): New sections. +Problem reported by Bdale Garbee in +. +--- + zgrep.1 | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/zgrep.1 b/zgrep.1 +index ef37bd8..dfcf21e 100644 +--- a/zgrep.1 ++++ b/zgrep.1 +@@ -23,6 +23,28 @@ If the GREP environment variable is set, + uses it as the + .I grep + program to be invoked. ++.SH "EXIT STATUS" ++Exit status is 0 for a match, 1 for no matches, and 2 if trouble. ++.SH BUGS ++.PP ++The following ++.I grep ++options are not supported: ++.B --dereference-recursive ++.RB ( \-R ), ++.B --directories ++.RB ( \-d ), ++.BR --exclude , ++.BR --exclude-from , ++.BR --exclude-dir , ++.BR --include , ++.B --null ++.RB ( \-Z ), ++.B --null-data ++.RB ( \-z ), ++and ++.B --recursive ++.RB ( \-r ). + .SH AUTHOR + Charles Levert (charles@comm.polymtl.ca) + .SH "SEE ALSO" +-- +cgit v1.0-41-gc330 + diff --git a/SOURCES/gzip-1.5-nonblock.patch b/SOURCES/gzip-1.5-nonblock.patch new file mode 100644 index 0000000..53aa392 --- /dev/null +++ b/SOURCES/gzip-1.5-nonblock.patch @@ -0,0 +1,35 @@ +diff --git a/util.c b/util.c +index 46bc89d..34fd789 100644 +--- a/util.c ++++ b/util.c +@@ -139,9 +139,29 @@ read_buffer (fd, buf, cnt) + voidp buf; + unsigned int cnt; + { ++ int len; ++#ifdef INT_MAX + if (INT_MAX < cnt) + cnt = INT_MAX; +- return read (fd, buf, cnt); ++#endif ++ len = read (fd, buf, cnt); ++ ++#if defined F_SETFL && O_NONBLOCK && defined EAGAIN ++ /* Iput files are opened O_NONBLOCK for security reasons. On some ++ file systems this can cause read to fail with errno == EAGAIN. */ ++ if (len < 0 && errno == EAGAIN) ++ { ++ int flags = fcntl (fd, F_GETFL); ++ if (0 <= flags) ++ { ++ if (! (flags & O_NONBLOCK)) ++ errno = EAGAIN; ++ else if (fcntl (fd, F_SETFL, flags & ~O_NONBLOCK) != -1) ++ len = read (fd, buf, cnt); ++ } ++ } ++#endif ++ return len; + } + + /* Likewise for 'write'. */ diff --git a/SOURCES/gzip-1.5-overwrite.patch b/SOURCES/gzip-1.5-overwrite.patch new file mode 100644 index 0000000..2ae70a6 --- /dev/null +++ b/SOURCES/gzip-1.5-overwrite.patch @@ -0,0 +1,22 @@ +diff --git a/gzip.c b/gzip.c +index 5d14022..e63cb44 100644 +--- a/gzip.c ++++ b/gzip.c +@@ -74,6 +74,7 @@ static char const *const license_msg[] = { + #include "ignore-value.h" + #include "stat-time.h" + #include "version.h" ++#include "yesno.h" + + /* configuration */ + +diff --git a/gzip.h b/gzip.h +index b88cefb..c696914 100644 +--- a/gzip.h ++++ b/gzip.h +@@ -325,5 +325,3 @@ extern void fprint_off (FILE *, off_t, int); + /* in inflate.c */ + extern int inflate (void); + +- /* in yesno.c */ +-extern int yesno (void); diff --git a/SPECS/gzip.spec b/SPECS/gzip.spec new file mode 100644 index 0000000..d486e5b --- /dev/null +++ b/SPECS/gzip.spec @@ -0,0 +1,454 @@ +Summary: The GNU data compression program +Name: gzip +Version: 1.5 +Release: 10%{?dist} +# info pages are under GFDL license +License: GPLv3+ and GFDL +Group: Applications/File +Source: http://ftp.gnu.org/gnu/gzip/gzip-%{version}.tar.xz +Patch0: gzip-1.3.12-openbsd-owl-tmp.patch +Patch1: gzip-1.3.5-zforce.patch +Patch4: gzip-1.3.13-rsync.patch +Patch5: gzip-1.3.9-addsuffix.patch +Patch6: gzip-1.3.5-cve-2006-4338.patch +Patch7: gzip-1.3.13-cve-2006-4337.patch +Patch8: gzip-1.3.5-cve-2006-4337_len.patch +Patch9: gzip-1.5-nonblock.patch +Patch10: gzip-1.5-overwrite.patch +Patch11: gzip-1.5-missing-grep-options-part1.patch +Patch12: gzip-1.5-missing-grep-options-part2.patch +# Fixed in upstream code. +# http://thread.gmane.org/gmane.comp.gnu.gzip.bugs/378 +URL: http://www.gzip.org/ +# Requires should not be added for gzip wrappers (eg. zdiff, zgrep, +# zless) of another tools, because gzip "extends" the tools by its +# wrappers much more than it "requires" them. +Requires: /sbin/install-info +Requires: coreutils +BuildRequires: texinfo +Conflicts: filesystem < 3 +Provides: /bin/gunzip +Provides: /bin/gzip +Provides: /bin/zcat +# Gzip contains bundled Gnulib +# exception https://fedorahosted.org/fpc/ticket/174 +Provides: bundled(gnulib) + +%description +The gzip package contains the popular GNU gzip data compression +program. Gzipped files have a .gz extension. + +Gzip should be installed on your system, because it is a +very commonly used data compression program. + +%prep +%setup -q +%patch0 -p1 -b .owl-tmp +%patch1 -p1 -b .zforce +%patch4 -p1 -b .rsync +%patch5 -p1 -b .addsuffix +%patch6 -p1 -b .4338 +%patch7 -p1 -b .4337 +%patch8 -p1 -b .4337l +%patch9 -p1 -b .nonblock +%patch10 -p1 -b .overwrite +%patch11 -p1 -b .options1 +%patch12 -p1 -b .options2 + +%build +export DEFS="NO_ASM" +export CPPFLAGS="-DHAVE_LSTAT" +%configure + +make +#make gzip.info + +%install +rm -rf ${RPM_BUILD_ROOT} +%makeinstall + +gzip -9nf ${RPM_BUILD_ROOT}%{_infodir}/gzip.info* + +# we don't ship it, so let's remove it from ${RPM_BUILD_ROOT} +rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir +# uncompress is a part of ncompress package +rm -f ${RPM_BUILD_ROOT}/%{_bindir}/uncompress + +%post +if [ -f %{_infodir}/gzip.info* ]; then + /sbin/install-info %{_infodir}/gzip.info.gz %{_infodir}/dir || : +fi + +%preun +if [ $1 = 0 ]; then + if [ -f %{_infodir}/gzip.info* ]; then + /sbin/install-info --delete %{_infodir}/gzip.info.gz %{_infodir}/dir || : + fi +fi + +%files +%defattr(-,root,root) +%doc NEWS README AUTHORS ChangeLog THANKS TODO +%{_bindir}/* +%{_mandir}/*/* +%{_infodir}/gzip.info* + +%changelog +* Mon Sep 11 2017 Jakub Martisko - 1.5-10 +- doc change: missing grep options are now mentioned in the zgrep + man pages/help message + Resolves: #1437002 + +* Tue Feb 28 2017 Petr Stodulka - 1.5-9 +- fix zfoce + Resolves: #1382054 + +* Mon Mar 16 2015 Petr Stodulka - 1.5-8 +- Gzip overwrite existing files when user choose "no" on yes/no question. + It's due to wrong dupicit declaration of yesno() function in gzip.h + which is compiled wrong with -O2 option. + Resolves: rhbz#1201689 + +* Fri Jan 24 2014 Daniel Mach - 1.5-7 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 1.5-6 +- Mass rebuild 2013-12-27 + +* Fri Nov 15 2013 Petr Stodulka - 1.5-5 +- fix issue with nonblocking open for PAR and OFL file + Resolves: rhbz#1028052 + +* Thu Feb 14 2013 Fedora Release Engineering - 1.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Nov 13 2012 Daniel Drake - 1.5-3 +- Fix "gzip --rsyncable" functionality by removing a spurious blank line from + the patch. + +* Thu Jul 19 2012 Fedora Release Engineering - 1.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Jun 21 2012 Michal Luscon +- Added bundled(glib) + +* Tue Jun 19 2012 Michal Luscon 1.5-1 +- New upstream version +- Removed gzip-1.3.9-stderr.patch +- Removed gzip-1.3.10-zgreppipe.patch +- Removed gzip-1.3.13-noemptysuffix.patch + +* Wed Jan 25 2012 Harald Hoyer 1.4-6 +- add filesystem guard + +* Wed Jan 25 2012 Harald Hoyer 1.4-5 +- install everything in /usr + https://fedoraproject.org/wiki/Features/UsrMove + +* Fri Jan 13 2012 Fedora Release Engineering - 1.4-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Feb 09 2011 Fedora Release Engineering - 1.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Sep 6 2010 Karel Klic - 1.4-2 +- Removed the dependency on less (rhbz#629580) +- Removed the BuildRoot tag +- Removed the %%clean section + +* Tue Mar 16 2010 Karel Klic - 1.4-1 +- New upstream release +- Use XZ upstream source archive +- Removed cve-2010-0001 patch as it's fixed in this release +- Removed zdiff patch as it's fixed in this release + +* Mon Feb 22 2010 Karel Klic - 1.3.13-3 +- Added a patch to disallow -S '' parameter (noemptysuffix) + +* Fri Jan 22 2010 Karel Klic - 1.3.13-2 +- Fixed CVE-2010-0001 (rhbz#554418) + +* Tue Dec 1 2009 Karel Klic - 1.3.13-1 +- New upstream version +- Updated license from GPLv2 to GPLv3+ +- Removed gzip-1.3.12-futimens.patch, as it is fixed in the new version +- Updated rsync patch to the new upstream version +- Updated cve-2006-4337 patch to use gzip_error instead of error + +* Fri Oct 9 2009 Ivana Varekova - 1.3.12-12 +- change the source tag + +* Tue Aug 11 2009 Ivana Varekova - 1.3.12-11 +- fix installation with --excludedocs option (#515975) + +* Fri Jul 24 2009 Fedora Release Engineering - 1.3.12-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Fri Mar 13 2009 Ivana Varekova - 1.3.12-9 +- fix #484213 - zdiff shows no output + +* Tue Feb 24 2009 Fedora Release Engineering - 1.3.12-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Sep 1 2008 Ivana Varekova - 1.3.12-7 +- update patches + +* Wed Feb 20 2008 Fedora Release Engineering - 1.3.12-6 +- Autorebuild for GCC 4.3 + +* Fri Jan 18 2008 Ivana Varekova - 1.3.12-5 +- rebuild + +* Tue Aug 28 2007 Fedora Release Engineering - 1.3.12-4 +- Rebuild for selinux ppc32 issue. + +* Fri Jun 15 2007 Ivana Varekova - 1.3.12-3 +- remove useless patches (fixed in upstream version) + +* Mon Jun 11 2007 Ivana Varekova - 1.3.12-2 +- remove useless patches + +* Mon Jun 4 2007 Ivana Varekova - 1.3.12-1 +- update to 1.3.12 + +* Mon Mar 5 2007 Ivana Varekova - 1.3.11-1 +- update to 1.3.11 + remove uncompress + +* Tue Feb 6 2007 Ivana Varekova - 1.3.10-1 +- Resolves: 225878 + update to 1.3.10 + change BuildRoot + +* Mon Jan 22 2007 Ivana Varekova - 1.3.9-2 +- Resolves: 223702 + fix non-failsafe install-info problem + +* Mon Jan 15 2007 Ivana Varekova - 1.3.9-1 +- rebuild to 1.3.9 +- spec cleanup + +* Wed Nov 22 2006 Ivana Varekova - 1.3.5-11 +- fix too strict uncompress function + +* Mon Oct 23 2006 Ivana Varekova - 1.3.5-10 +- fix package description (#208924) + +* Sun Oct 01 2006 Jesse Keating - 1.3.5-9 +- rebuilt for unwind info generation, broken in gcc-4.1.1-21 + +* Wed Sep 20 2006 Ivana Varekova 1.3.5-8 +- fix bug 204676 (patches by Tavis Ormandy) + - cve-2006-4334 - null dereference problem + - cve-2006-4335 - buffer overflow problem + - cve-2006-4336 - buffer underflow problem + - cve-2006-4338 - infinite loop problem + - cve-2006-4337 - buffer overflow problem + +* Fri Jul 14 2006 Karsten Hopp 1.3.5-7 +- buildrequire texinfo, otherwise gzip.info will be empty + +* Wed Jul 12 2006 Jesse Keating - 1.3.5-6.2.2 +- rebuild + +* Fri Feb 10 2006 Jesse Keating - 1.3.5-6.2.1 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 1.3.5-6.2 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Mon May 02 2005 Ivana Varekova 1.3.5-6 +- rebuilt + +* Fri Apr 29 2005 Ivana Varekova 1.3.5-5 +- fix bug 156269 - CAN-2005-1228 directory traversal bug + (using the patch from Ulf Harnhammar) + +* Tue Apr 26 2005 Ivana Varekova 1.3.5-4 +- fix bug 155746 - CAN-2005-0988 Race condition in gzip (patch9) + +* Wed Mar 23 2005 Tomas Mraz 1.3.5-3 +- don't use the asm code again as it's slower than the gcc compiled one +- convert the .spec to UTF-8 + +* Tue Mar 22 2005 Tomas Mraz 1.3.5-2 +- upstream 1.3.5 +- dropped long ago obsolete dirinfo patch +- escape file names in zgrep (#123012) +- make stack in match.S nonexecutable + +* Fri Mar 04 2005 Jiri Ryska +- rebuilt + +* Mon Dec 13 2004 Ivana Varekova +- fix patch - remove brackets + +* Mon Dec 13 2004 Ivana Varekova +- fix bug #106551 problem with zmore which requires the suffix .gz in file name + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Tue Oct 28 2003 Jeff Johnson 1.3.3-11 +- rebuilt. + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Fri Jan 31 2003 Jeff Johnson 1.3.3-9 +- enlarge window buffer to avoid accessing beyond end-of-buffer (#78413,#83095). +- re-enable rsync ready patch. + +* Wed Jan 22 2003 Tim Powers +- rebuilt + +* Fri Nov 22 2002 Jeff Johnson 1.3.3-7 +- workaround mis-compilation with gcc-3.2-4 on alpha for now (#78413). + +* Mon Nov 18 2002 Tim Powers +- rebuild on all arches +- remove file from buildroot we aren't shipping + +* Fri Jun 21 2002 Tim Powers +- automated rebuild + +* Fri Jun 21 2002 Trond Eivind Glomsrød 1.3.3-4 +- Fix the reading of unitialized memory problem (#66913) + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Thu Apr 25 2002 Trond Eivind Glomsrød 1.3.3-2 +- Rebuild + +* Wed Mar 13 2002 Trond Eivind Glomsrød 1.3.3-1 +- 1.3.3 + +* Sun Mar 10 2002 Florian La Roche +- add rsyncable patch #58888 + +* Thu Feb 21 2002 Trond Eivind Glomsrød 1.3.2-3 +- Rebuild + +* Wed Jan 09 2002 Tim Powers +- automated rebuild + +* Mon Nov 19 2001 Bernhard Rosenkraenzer 1.3.2-1 +- 1.3.2: no need for autoconf 2.5x hacks anymore + +* Sat Nov 17 2001 Florian La Roche +- update to 1.3.1: +- disable patch2 + +* Fri Oct 26 2001 Trond Eivind Glomsrød 1.3.0-16 +- replace tempfile patches with improved ones solar@openwall.com +- Add less to the dependency chain - zless needs it + +* Thu Aug 23 2001 Trond Eivind Glomsrød 1.3.0-15 +- Fix typo in comment in zgrep (#52465) +- Copyright -> License + +* Tue Jun 5 2001 Trond Eivind Glomsrød +- Patch various uses of $$ in the bundled scripts + +* Mon Jun 4 2001 Trond Eivind Glomsrød +- Fix the SIGPIPE patch to avoid blank lines (#43319) + +* Thu Feb 08 2001 Philipp Knirsch +- Fixed buzilla bug #26680. Wrong skip value after mktemp patch and forced + overwrite for output file during decompression. + +* Tue Jan 30 2001 Trond Eivind Glomsrød +- trap SIGPIPE in zgrep, so "zgrep | less" gets a happy ending + (#24104) + +* Sun Dec 10 2000 Trond Eivind Glomsrød +- add HAVE_LSTAT define, to avoid it doing weird things to symlinks + instead of ignoring them as the docs say it should (#22045) + +* Fri Dec 01 2000 Trond Eivind Glomsrød +- rebuild + +* Thu Nov 09 2000 Trond Eivind Glomsrød +- patch all scripts so usage error messages are written to + stderr (#20597) + +* Mon Oct 30 2000 Trond Eivind Glomsrød +- disable assembly, as it is faster without it (bug #19910) + +* Thu Jul 13 2000 Prospector +- automatic rebuild + +* Tue Jun 27 2000 Trond Eivind Glomsrød +- rebuild + +* Wed Jun 07 2000 Trond Eivind Glomsrød +- Use %%{_mandir}, %%{_infodir}, %%configure, %%makeinstall + and %%{_tmppath} + +* Fri May 12 2000 Trond Eivind Glomsrød +- Add root as default owner of the files, permits building + as non-root user + +* Wed May 10 2000 Trond Eivind Glomsrød +- Build system handles stripping +- Don't do thing the system does, like creating directories +- use --bindir /bin +- Added URL +- skip unnecesarry sed step +- Include THANKS, AUTHORS, ChangeLog, TODO + +* Mon Mar 20 2000 Bernhard Rosenkraenzer +- 1.3 +- handle RPM_OPT_FLAGS + +* Tue Feb 15 2000 Cristian Gafton +- handle compressed man pages even better + +* Tue Feb 08 2000 Cristian Gafton +- adopt patch from Paul Eggert to fix detection of the improper tables in + inflate.c(huft_build) +- the latest released version 1.2.4a, which provides documentation updates + only. But it lets us use small revision numbers again +- add an dirinfo entry for gzip.info so we can get rid of the ugly --entry + args to install-info + +* Mon Feb 7 2000 Bill Nottingham +- handle compressed manpages + +* Thu Feb 03 2000 Elliot Lee +- Fix bug #7970 + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 14) + +* Thu Dec 17 1998 Cristian Gafton +- built against gliibc 2.1 + +* Thu May 07 1998 Prospector System +- translations modified for de, fr, tr + +* Thu Apr 09 1998 Cristian Gafton +- added /usr/bin/gzip and /usr/bin/gunzip symlinks as some programs are too + brain dead to figure out they should be at least trying to use $PATH +- added BuildRoot + +* Wed Jan 28 1998 Erik Troan +- fix /tmp races + +* Sun Sep 14 1997 Erik Troan +- uses install-info +- applied patch for gzexe + +* Mon Jun 02 1997 Erik Troan +- built against glibc + +* Tue Apr 22 1997 Marc Ewing +- (Entry added for Marc by Erik) fixed gzexe to use /bin/gzip +