Hello community, here is the log from the commit of package bzip2 checked in at Fri Jan 19 12:25:01 CET 2007. -------- --- bzip2/bzip2.changes 2006-10-16 12:15:11.000000000 +0200 +++ /mounts/work_src_done/STABLE/bzip2/bzip2.changes 2007-01-17 18:16:31.000000000 +0100 @@ -1,0 +2,19 @@ +Mon Jan 15 13:50:53 CET 2007 - lmichnovic@suse.cz + +- Update to version 1.0.4 + + * Fixes some minor bugs since the last version, 1.0.3. + * Fix file permissions race problem (CAN-2005-0953). + * Avoid possible segfault in BZ2_bzclose. From Coverity's NetBSD + scan. + * 'const'/prototype cleanups in the C code. + * Change default install location to /usr/local, and handle + multiple 'make install's without error. + * Sanitise file names more carefully in bzgrep. Fixes + CAN-2005-0758 to the extent that applies to bzgrep. + * Use 'mktemp' rather than 'tempfile' in bzdiff. + * Tighten up a couple of assertions in blocksort.c following + automated analysis. + * Fix minor doc/comment bugs. + +------------------------------------------------------------------- Old: ---- bzip2-1.0.3.diff bzip2-1.0.3.tar.gz bzip2-faster.diff bzip2-maxlen20.diff New: ---- bzip2-1.0.4-makefile.patch bzip2-1.0.4.tar.gz bzip2-faster.patch bzip2-maxlen20.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ bzip2.spec ++++++ --- /var/tmp/diff_new_pack.g24985/_old 2007-01-19 12:15:37.000000000 +0100 +++ /var/tmp/diff_new_pack.g24985/_new 2007-01-19 12:15:37.000000000 +0100 @@ -1,7 +1,7 @@ # -# spec file for package bzip2 (Version 1.0.3) +# spec file for package bzip2 (Version 1.0.4) # -# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # @@ -11,21 +11,21 @@ # norootforbuild Name: bzip2 -Version: 1.0.3 -Release: 26 +Version: 1.0.4 +Release: 1 Provides: bzip Obsoletes: bzip Autoreqprov: on Group: Productivity/Archiving/Compression -License: Other License(s), see package +License: BSD License and BSD-like URL: http://www.bzip.org/ Summary: A Program for Compressing Files Source: bzip2-%{version}.tar.gz Source1: bznew.gz Source2: bznew.1.gz -Patch: bzip2-%{version}.diff -Patch2: bzip2-maxlen20.diff -Patch3: bzip2-faster.diff +Patch1: bzip2-%{version}-makefile.patch +Patch2: bzip2-maxlen20.patch +Patch3: bzip2-faster.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -39,7 +39,7 @@ %prep %setup -q -%patch +%patch1 %patch2 %patch3 @@ -76,6 +76,21 @@ %{_bindir}/* %changelog -n bzip2 +* Mon Jan 15 2007 - lmichnovic@suse.cz +- Update to version 1.0.4 + * Fixes some minor bugs since the last version, 1.0.3. + * Fix file permissions race problem (CAN-2005-0953). + * Avoid possible segfault in BZ2_bzclose. From Coverity's NetBSD + scan. + * 'const'/prototype cleanups in the C code. + * Change default install location to /usr/local, and handle + multiple 'make install's without error. + * Sanitise file names more carefully in bzgrep. Fixes + CAN-2005-0758 to the extent that applies to bzgrep. + * Use 'mktemp' rather than 'tempfile' in bzdiff. + * Tighten up a couple of assertions in blocksort.c following + automated analysis. + * Fix minor doc/comment bugs. * Mon Oct 16 2006 - dmueller@suse.de - strip .la files * Wed Jan 25 2006 - mls@suse.de ++++++ bzip2-1.0.4-makefile.patch ++++++ --- Makefile +++ Makefile @@ -24,33 +24,50 @@ CFLAGS=-Wall -Winline -O2 -g $(BIGFILES) # Where you want it installed when you do 'make install' -PREFIX=/usr/local +PREFIX=/usr -OBJS= blocksort.o \ - huffman.o \ - crctable.o \ - randtable.o \ - compress.o \ - decompress.o \ - bzlib.o +OBJS= blocksort.lo \ + huffman.lo \ + crctable.lo \ + randtable.lo \ + compress.lo \ + decompress.lo \ + bzlib.lo + +LIB= libbz2.la + +prefix= /usr +bindir= $(prefix)/bin +libdir= $(prefix)/lib +mandir= $(prefix)/share/man +includedir= $(prefix)/include + +all: $(LIB) bzip2 bzip2recover test + +install: all test + mkdir -p $(PREFIX)$(bindir) + libtool --mode=install install -m 0755 bzip2 bzip2recover $(PREFIX)$(bindir) + ln -sf bzip2 $(PREFIX)$(bindir)/bunzip2 + ln -sf bzip2 $(PREFIX)$(bindir)/bzcat + mkdir -p $(PREFIX)$(mandir)/man1 + install -c -m 0644 bzip2.1 $(PREFIX)$(mandir)/man1/bzip2.1 + ln -sf bzip2.1 $(PREFIX)$(mandir)/man1/bunzip2.1 + ln -sf bzip2.1 $(PREFIX)$(mandir)/man1/bzcat.1 + mkdir -p $(PREFIX)$(libdir) + libtool --mode=install install $(LIB) $(PREFIX)$(libdir) + mkdir -p $(PREFIX)$(includedir) + install -c -m 0644 bzlib.h $(PREFIX)$(includedir) -all: libbz2.a bzip2 bzip2recover test - -bzip2: libbz2.a bzip2.o - $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2 +bzip2: bzip2.o $(LIB) + libtool --mode=link $(CC) $(CFLAGS) -o $@ bzip2.o $(LIB) bzip2recover: bzip2recover.o - $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o + libtool --mode=link $(CC) $(CFLAGS) -o $@ bzip2recover.o -libbz2.a: $(OBJS) - rm -f libbz2.a - $(AR) cq libbz2.a $(OBJS) - @if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \ - -f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \ - echo $(RANLIB) libbz2.a ; \ - $(RANLIB) libbz2.a ; \ - fi +$(LIB): $(OBJS) + libtool --mode=link $(CC) $(CFLAGS) -o $@ $(OBJS) -rpath $(libdir) \ + -version-info 1:0:0 check: test test: bzip2 @@ -69,70 +86,18 @@ cmp sample3.tst sample3.ref @cat words3 -install: bzip2 bzip2recover - if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi - if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi - if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi - if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi - if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi - cp -f bzip2 $(PREFIX)/bin/bzip2 - cp -f bzip2 $(PREFIX)/bin/bunzip2 - cp -f bzip2 $(PREFIX)/bin/bzcat - cp -f bzip2recover $(PREFIX)/bin/bzip2recover - chmod a+x $(PREFIX)/bin/bzip2 - chmod a+x $(PREFIX)/bin/bunzip2 - chmod a+x $(PREFIX)/bin/bzcat - chmod a+x $(PREFIX)/bin/bzip2recover - cp -f bzip2.1 $(PREFIX)/man/man1 - chmod a+r $(PREFIX)/man/man1/bzip2.1 - cp -f bzlib.h $(PREFIX)/include - chmod a+r $(PREFIX)/include/bzlib.h - cp -f libbz2.a $(PREFIX)/lib - chmod a+r $(PREFIX)/lib/libbz2.a - cp -f bzgrep $(PREFIX)/bin/bzgrep - ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep - ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep - chmod a+x $(PREFIX)/bin/bzgrep - cp -f bzmore $(PREFIX)/bin/bzmore - ln -s -f $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless - chmod a+x $(PREFIX)/bin/bzmore - cp -f bzdiff $(PREFIX)/bin/bzdiff - ln -s -f $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp - chmod a+x $(PREFIX)/bin/bzdiff - cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1 - chmod a+r $(PREFIX)/man/man1/bzgrep.1 - chmod a+r $(PREFIX)/man/man1/bzmore.1 - chmod a+r $(PREFIX)/man/man1/bzdiff.1 - echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1 - echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1 - echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1 - echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1 - clean: - rm -f *.o libbz2.a bzip2 bzip2recover \ + rm -f *.o *.a $(LIB) bzip2 bzip2recover \ sample1.rb2 sample2.rb2 sample3.rb2 \ sample1.tst sample2.tst sample3.tst -blocksort.o: blocksort.c - @cat words0 - $(CC) $(CFLAGS) -c blocksort.c -huffman.o: huffman.c - $(CC) $(CFLAGS) -c huffman.c -crctable.o: crctable.c - $(CC) $(CFLAGS) -c crctable.c -randtable.o: randtable.c - $(CC) $(CFLAGS) -c randtable.c -compress.o: compress.c - $(CC) $(CFLAGS) -c compress.c -decompress.o: decompress.c - $(CC) $(CFLAGS) -c decompress.c -bzlib.o: bzlib.c - $(CC) $(CFLAGS) -c bzlib.c -bzip2.o: bzip2.c - $(CC) $(CFLAGS) -c bzip2.c -bzip2recover.o: bzip2recover.c - $(CC) $(CFLAGS) -c bzip2recover.c +.SUFFIXES: .c .o .lo + +%.o: %.c bzlib.h bzlib_private.h + $(CC) $(CFLAGS) -c $< +%.lo: %.c bzlib.h bzlib_private.h + libtool --mode=compile $(CC) $(CFLAGS) -c $< distclean: clean rm -f manual.ps manual.html manual.pdf ++++++ bzip2-1.0.3.tar.gz -> bzip2-1.0.4.tar.gz ++++++ ++++ 131345 lines of diff (skipped) ++++++ bzip2-faster.patch ++++++ --- ./bzlib_private.h.orig 2005-08-12 10:40:07.000000000 +0000 +++ ./bzlib_private.h 2005-08-12 10:50:02.000000000 +0000 @@ -374,6 +374,7 @@ BZ2_hbMakeCodeLengths ( UChar*, Int32*, #define MTFA_SIZE 4096 #define MTFL_SIZE 16 +#define HUFCODE_SIZE 10 /*-- Structure holding all the decompression-side stuff. --*/ @@ -441,6 +442,7 @@ typedef Int32 base [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; Int32 perm [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; Int32 minLens[BZ_N_GROUPS]; + Int16 hufcode[BZ_N_GROUPS][1 << HUFCODE_SIZE]; /* save area for scalars in the main decompress code */ Int32 save_i; @@ -467,6 +469,7 @@ typedef Int32* save_gLimit; Int32* save_gBase; Int32* save_gPerm; + Int16* save_gHufCode; } DState; @@ -516,8 +519,8 @@ extern Int32 BZ2_decompress ( DState* ); extern void -BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*, - Int32, Int32, Int32 ); +BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, Int16 *, + UChar*, Int32, Int32, Int32 ); #endif --- ./decompress.c.orig 2005-08-12 10:27:55.000000000 +0000 +++ ./decompress.c 2005-08-12 12:08:14.188288783 +0000 @@ -104,6 +104,9 @@ void makeMaps_d ( DState* s ) s->strm->total_in_hi32++; \ } +#define UNGET_BITS(nnn) \ + s->bsLive += nnn + #define GET_UCHAR(lll,uuu) \ GET_BITS(lll,uuu,8) @@ -123,23 +126,29 @@ void makeMaps_d ( DState* s ) gLimit = &(s->limit[gSel][0]); \ gPerm = &(s->perm[gSel][0]); \ gBase = &(s->base[gSel][0]); \ + gHufCode = &(s->hufcode[gSel][0]); \ } \ groupPos--; \ - zn = gMinlen; \ + zn = HUFCODE_SIZE; \ GET_BITS(label1, zvec, zn); \ - while (1) { \ - if (zn > 20 /* the longest code */) \ - RETURN(BZ_DATA_ERROR); \ - if (zvec <= gLimit[zn]) break; \ - zn++; \ - GET_BIT(label2, zj); \ - zvec = (zvec << 1) | zj; \ - }; \ - if (zvec - gBase[zn] < 0 \ + if (gHufCode[zvec]) { \ + UNGET_BITS(gHufCode[zvec] >> 10); \ + lval = gHufCode[zvec] & 511; \ + } else { \ + while (1) { \ + if (zn > 20 /* the longest code */) \ + RETURN(BZ_DATA_ERROR); \ + if (zvec <= gLimit[zn]) break; \ + zn++; \ + GET_BIT(label2, zj); \ + zvec = (zvec << 1) | zj; \ + }; \ + if (zvec - gBase[zn] < 0 \ || zvec - gBase[zn] >= BZ_MAX_ALPHA_SIZE) \ - RETURN(BZ_DATA_ERROR); \ - lval = gPerm[zvec - gBase[zn]]; \ -} + RETURN(BZ_DATA_ERROR); \ + lval = gPerm[zvec - gBase[zn]]; \ + } \ +} \ /*---------------------------------------------------*/ @@ -175,6 +184,7 @@ Int32 BZ2_decompress ( DState* s ) Int32* gLimit; Int32* gBase; Int32* gPerm; + Int16* gHufCode; if (s->state == BZ_X_MAGIC_1) { /*initialise the save area*/ @@ -202,6 +212,7 @@ Int32 BZ2_decompress ( DState* s ) s->save_gLimit = NULL; s->save_gBase = NULL; s->save_gPerm = NULL; + s->save_gHufCode = NULL; } /*restore from the save area*/ @@ -229,6 +240,7 @@ Int32 BZ2_decompress ( DState* s ) gLimit = s->save_gLimit; gBase = s->save_gBase; gPerm = s->save_gPerm; + gHufCode = s->save_gHufCode; retVal = BZ_OK; @@ -380,6 +392,7 @@ Int32 BZ2_decompress ( DState* s ) &(s->limit[t][0]), &(s->base[t][0]), &(s->perm[t][0]), + &(s->hufcode[t][0]), &(s->len[t][0]), minLen, maxLen, alphaSize ); @@ -454,6 +467,62 @@ Int32 BZ2_decompress ( DState* s ) if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR); /*-- uc = MTF ( nextSym-1 ) --*/ +#if MTFL_SIZE == 16 + { + unsigned char *ppx = s->mtfa + s->mtfbase[0]; + int lno = 0; + + nextSym--; + if (nextSym >= MTFL_SIZE) { + lno = nextSym / MTFL_SIZE; + nextSym %= MTFL_SIZE; + ppx = s->mtfa + s->mtfbase[lno]; + } + uc = ppx[nextSym]; + switch(nextSym) { + case 9: ppx[9] = ppx[10]; + case 10: ppx[10] = ppx[11]; + case 11: ppx[11] = ppx[12]; + case 12: ppx[12] = ppx[13]; + case 13: ppx[13] = ppx[14]; + case 14: ppx[14] = ppx[15]; + case 15: goto copy; + + case 8: ppx[8] = ppx[7]; + case 7: ppx[7] = ppx[6]; + case 6: ppx[6] = ppx[5]; + case 5: ppx[5] = ppx[4]; + case 4: ppx[4] = ppx[3]; + case 3: ppx[3] = ppx[2]; + case 2: ppx[2] = ppx[1]; + case 1: ppx[1] = ppx[0]; + default: break; + } + if (lno) { + s->mtfbase[lno]++; + copy: + while (lno > 0) { + s->mtfbase[lno]--; + s->mtfa[s->mtfbase[lno]] = s->mtfa[s->mtfbase[lno-1] + MTFL_SIZE - 1]; + lno--; + } + s->mtfbase[0]--; + if (s->mtfbase[0] == 0) { + int ii, jj, kk; + s->mtfa[0] = uc; + kk = MTFA_SIZE-1; + for (ii = 256 / MTFL_SIZE-1; ii >= 0; ii--) { + for (jj = MTFL_SIZE-1; jj >= 0; jj--) { + s->mtfa[kk] = s->mtfa[s->mtfbase[ii] + jj]; + kk--; + } + s->mtfbase[ii] = kk + 1; + } + } + } + s->mtfa[s->mtfbase[0]] = uc; + } +#else { Int32 ii, jj, kk, pp, lno, off; UInt32 nn; @@ -505,6 +574,7 @@ Int32 BZ2_decompress ( DState* s ) } } } +#endif /*-- end uc = MTF ( nextSym-1 ) --*/ s->unzftab[s->seqToUnseq[uc]]++; @@ -656,6 +726,7 @@ Int32 BZ2_decompress ( DState* s ) s->save_gLimit = gLimit; s->save_gBase = gBase; s->save_gPerm = gPerm; + s->save_gHufCode = gHufCode; return retVal; } --- ./huffman.c.orig 2005-08-12 10:45:28.000000000 +0000 +++ ./huffman.c 2005-08-12 12:04:19.000000000 +0000 @@ -210,13 +213,16 @@ void BZ2_hbAssignCodes ( Int32 *code, void BZ2_hbCreateDecodeTables ( Int32 *limit, Int32 *base, Int32 *perm, + Int16 *hufcode, UChar *length, Int32 minLen, Int32 maxLen, Int32 alphaSize ) { - Int32 pp, i, j, vec; + Int32 pp, i, j, vec, k, vec2; + for (i = 0; i < (1 << HUFCODE_SIZE); i++) + hufcode[i] = 0; pp = 0; for (i = minLen; i <= maxLen; i++) for (j = 0; j < alphaSize; j++) @@ -227,16 +233,25 @@ void BZ2_hbCreateDecodeTables ( Int32 *l for (i = 1; i < BZ_MAX_CODE_LEN; i++) base[i] += base[i-1]; - for (i = 0; i < BZ_MAX_CODE_LEN; i++) limit[i] = 0; + for (i = 0; i < BZ_MAX_CODE_LEN; i++) limit[i] = -1; vec = 0; for (i = minLen; i <= maxLen; i++) { + if (i <= HUFCODE_SIZE) { + for (j = base[i]; j < base[i + 1]; j++) { + vec2 = (vec + j - base[i]) << (HUFCODE_SIZE - i); + for (k = (1 << (HUFCODE_SIZE - i)) ; --k >= 0; vec2++) + hufcode[vec2] = perm[j] | 512 | (HUFCODE_SIZE - i) << 10; + } + } vec += (base[i+1] - base[i]); limit[i] = vec-1; vec <<= 1; } for (i = minLen + 1; i <= maxLen; i++) base[i] = ((limit[i-1] + 1) << 1) - base[i]; + limit[maxLen + 1] = 0x7fffffff; /* make it terminate */ + base[maxLen + 1] = 0; } ++++++ bzip2-maxlen20.patch ++++++ --- ./compress.c.orig 2005-08-12 12:02:26.000000000 +0000 +++ ./compress.c 2005-08-12 12:03:16.000000000 +0000 @@ -488,11 +488,9 @@ void sendMTFValues ( EState* s ) /*-- Recompute the tables based on the accumulated frequencies. --*/ - /* maxLen was changed from 20 to 17 in bzip2-1.0.3. See - comment in huffman.c for details. */ for (t = 0; t < nGroups; t++) BZ2_hbMakeCodeLengths ( &(s->len[t][0]), &(s->rfreq[t][0]), - alphaSize, 17 /*20*/ ); + alphaSize, 20 ); } @@ -529,7 +527,7 @@ void sendMTFValues ( EState* s ) if (s->len[t][i] > maxLen) maxLen = s->len[t][i]; if (s->len[t][i] < minLen) minLen = s->len[t][i]; } - AssertH ( !(maxLen > 17 /*20*/ ), 3004 ); + AssertH ( !(maxLen > 20), 3004 ); AssertH ( !(minLen < 1), 3005 ); BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]), minLen, maxLen, alphaSize ); --- ./huffman.c.orig 2005-08-12 10:45:28.000000000 +0000 +++ ./huffman.c 2005-08-12 12:04:19.000000000 +0000 @@ -177,7 +177,10 @@ void BZ2_hbMakeCodeLengths ( UChar *len, Huffman codes with a maximum length of 17 bits. However, in order to preserve backwards compatibility with bitstreams produced by versions pre-1.0.3, the decompressor must still - handle lengths of up to 20. */ + handle lengths of up to 20. + + SuSE: we changed it back to 20 to be compatible to older + bzip2 versions */ for (i = 1; i <= alphaSize; i++) { j = weight[i] >> 8; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org