Skip to content

Commit

Permalink
Merge commit '6a8690fc8d26c815e798c588f796eabe9d684cf0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibras committed May 9, 2020
2 parents c559e20 + 6a8690f commit 8bc00ae
Show file tree
Hide file tree
Showing 34 changed files with 153 additions and 103 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.ref binary
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.o
*.obj
*.rb2
*.tst
*.a
*.lib
*.exe
bzip2
bzip2recover
20 changes: 18 additions & 2 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.

bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <[email protected]>
bzip2/libbzip2 version 1.0.8 of 13 July 2019
Copyright (C) 1996-2019 Julian Seward <[email protected]>

Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
Expand Down Expand Up @@ -338,3 +338,19 @@ Security fix only. Fixes CERT-FI 20469 as it applies to bzip2.
* bzip2recover: Fix use after free issue with outFile (CVE-2016-3189)

* Make sure nSelectors is not out of range (CVE-2019-12900)

1.0.8 (13 Jul 19)
~~~~~~~~~~~~~~~~~

* Accept as many selectors as the file format allows.
This relaxes the fix for CVE-2019-12900 from 1.0.7
so that bzip2 allows decompression of bz2 files that
use (too) many selectors again.

* Fix handling of large (> 4GB) files on Windows.

* Cleanup of bzdiff and bzgrep scripts so they don't use
any bash extensions and handle multiple archives correctly.

* There is now a bz2-files testsuite at
https://sourceware.org/git/bzip2-tests.git
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--------------------------------------------------------------------------

This program, "bzip2", the associated library "libbzip2", and all
documentation, are copyright (C) 1996-2010 Julian R Seward. All
documentation, are copyright (C) 1996-2019 Julian R Seward. All
rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -37,6 +37,6 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Julian Seward, [email protected]
bzip2/libbzip2 version 1.0.7 of 27 June 2019
bzip2/libbzip2 version 1.0.8 of 13 July 2019

--------------------------------------------------------------------------
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# This file is part of bzip2/libbzip2, a program and library for
# lossless, block-sorting data compression.
#
# bzip2/libbzip2 version 1.0.6 of 6 September 2010
# Copyright (C) 1996-2010 Julian Seward <[email protected]>
# bzip2/libbzip2 version 1.0.8 of 13 July 2019
# Copyright (C) 1996-2019 Julian Seward <[email protected]>
#
# Please read the WARNING, DISCLAIMER and PATENTS sections in the
# README file.
Expand Down Expand Up @@ -137,7 +137,7 @@ bzip2recover.o: bzip2recover.c
distclean: clean
rm -f manual.ps manual.html manual.pdf

DISTNAME=bzip2-1.0.7
DISTNAME=bzip2-1.0.8
dist: check manual
rm -f $(DISTNAME)
ln -s -f . $(DISTNAME)
Expand Down
14 changes: 7 additions & 7 deletions Makefile-libbz2_so
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# This Makefile builds a shared version of the library,
# libbz2.so.1.0.7, with soname libbz2.so.1.0,
# libbz2.so.1.0.8, with soname libbz2.so.1.0,
# at least on x86-Linux (RedHat 7.2),
# with gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98).
# Please see the README file for some important info
Expand All @@ -10,8 +10,8 @@
# This file is part of bzip2/libbzip2, a program and library for
# lossless, block-sorting data compression.
#
# bzip2/libbzip2 version 1.0.6 of 6 September 2010
# Copyright (C) 1996-2010 Julian Seward <[email protected]>
# bzip2/libbzip2 version 1.0.8 of 13 July 2019
# Copyright (C) 1996-2019 Julian Seward <[email protected]>
#
# Please read the WARNING, DISCLAIMER and PATENTS sections in the
# README file.
Expand All @@ -35,13 +35,13 @@ OBJS= blocksort.o \
bzlib.o

all: $(OBJS)
$(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.7 $(OBJS)
$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.7
$(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS)
$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8
rm -f libbz2.so.1.0
ln -s libbz2.so.1.0.7 libbz2.so.1.0
ln -s libbz2.so.1.0.8 libbz2.so.1.0

clean:
rm -f $(OBJS) bzip2.o libbz2.so.1.0.7 libbz2.so.1.0 bzip2-shared
rm -f $(OBJS) bzip2.o libbz2.so.1.0.8 libbz2.so.1.0 bzip2-shared

blocksort.o: blocksort.c
$(CC) $(CFLAGS) -c blocksort.c
Expand Down
9 changes: 5 additions & 4 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ This version is fully compatible with the previous public releases.
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.

bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <[email protected]>
bzip2/libbzip2 version 1.0.8 of 13 July 2019
Copyright (C) 1996-2019 Julian Seward <[email protected]>

Please read the WARNING, DISCLAIMER and PATENTS sections in this file.

Expand Down Expand Up @@ -165,8 +165,8 @@ WHAT'S NEW IN 1.0.x ?

See the CHANGES file.

I hope you find bzip2 useful. Feel free to contact me at
jseward@acm.org
I hope you find bzip2 useful. Feel free to contact the developers at
bzip2-devel@sourceware.org
if you have any suggestions or queries. Many people mailed me with
comments, suggestions and patches after the releases of bzip-0.15,
bzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1,
Expand All @@ -193,3 +193,4 @@ Cambridge, UK.
10 December 2007 (bzip2, version 1.0.5)
6 Sept 2010 (bzip2, version 1.0.6)
27 June 2019 (bzip2, version 1.0.7)
13 July 2019 (bzip2, version 1.0.8)
4 changes: 2 additions & 2 deletions README.COMPILATION.PROBLEMS
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.

bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <[email protected]>
bzip2/libbzip2 version 1.0.8 of 13 July 2019
Copyright (C) 1996-2019 Julian Seward <[email protected]>

Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
Expand Down
4 changes: 2 additions & 2 deletions README.XML.STUFF
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.

bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <[email protected]>
bzip2/libbzip2 version 1.0.8 of 13 July 2019
Copyright (C) 1996-2019 Julian Seward <[email protected]>

Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
Expand Down
4 changes: 2 additions & 2 deletions blocksort.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <[email protected]>
bzip2/libbzip2 version 1.0.8 of 13 July 2019
Copyright (C) 1996-2019 Julian Seward <[email protected]>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
Expand Down
16 changes: 8 additions & 8 deletions bzdiff
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ if test -z "$FILES"; then
echo "Usage: $prog [${comp}_options] file [file]"
exit 1
fi
tmp=`mktemp ${TMPDIR:-/tmp}/bzdiff.XXXXXXXXXX` || {
echo 'cannot create a temporary file' >&2
exit 1
}
set $FILES
if test $# -eq 1; then
FILE=`echo "$1" | sed 's/.bz2$//'`
Expand All @@ -53,10 +49,14 @@ elif test $# -eq 2; then
case "$2" in
*.bz2)
F=`echo "$2" | sed 's|.*/||;s|.bz2$||'`
bzip2 -cdfq "$2" > $tmp
bzip2 -cdfq "$1" | $comp $OPTIONS - $tmp
tmp=`mktemp "${TMPDIR:-/tmp}"/bzdiff.XXXXXXXXXX` || {
echo 'cannot create a temporary file' >&2
exit 1
}
bzip2 -cdfq "$2" > "$tmp"
bzip2 -cdfq "$1" | $comp $OPTIONS - "$tmp"
STAT="$?"
/bin/rm -f $tmp;;
/bin/rm -f "$tmp";;

*) bzip2 -cdfq "$1" | $comp $OPTIONS - "$2"
STAT="$?";;
Expand All @@ -69,8 +69,8 @@ elif test $# -eq 2; then
STAT="$?";;
esac;;
esac
exit "$STAT"
else
echo "Usage: $prog [${comp}_options] file [file]"
exit 1
fi
exit "$STAT"
20 changes: 15 additions & 5 deletions bzgrep
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,22 @@ for i do
bzip2 -cdfq "$i" | $grep $opt "$pat"
r=$?
else
j=${i//\\/\\\\}
j=${j//|/\\|}
j=${j//&/\\&}
j=$(echo "$i" | sed 's/\\/&&/g;s/|/\\&/g;s/&/\\&/g')
j=`printf "%s" "$j" | tr '\n' ' '`
bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|"
r=$?
# A trick adapted from
# https://groups.google.com/forum/#!original/comp.unix.shell/x1345iu10eg/Nn1n-1r1uU0J
# that has the same effect as the following bash code:
# bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|"
# r=${PIPESTATUS[1]}
exec 3>&1
eval `
exec 4>&1 >&3 3>&-
{
bzip2 -cdfq "$i" 4>&-
} | {
$grep $opt "$pat" 4>&-; echo "r=$?;" >&4
} | sed "s|^|${j}:|"
`
fi
test "$r" -ne 0 && res="$r"
done
Expand Down
4 changes: 2 additions & 2 deletions bzip2.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PU
.TH bzip2 1
.SH NAME
bzip2, bunzip2 \- a block-sorting file compressor, v1.0.7
bzip2, bunzip2 \- a block-sorting file compressor, v1.0.8
.br
bzcat \- decompresses files to stdout
.br
Expand Down Expand Up @@ -405,7 +405,7 @@ I/O error messages are not as helpful as they could be.
tries hard to detect I/O errors and exit cleanly, but the details of
what the problem is sometimes seem rather misleading.

This manual page pertains to version 1.0.7 of
This manual page pertains to version 1.0.8 of
.I bzip2.
Compressed data created by this version is entirely forwards and
backwards compatible with the previous public releases, versions
Expand Down
4 changes: 2 additions & 2 deletions bzip2.1.preformatted
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ bzip2(1) bzip2(1)


NNAAMMEE
bzip2, bunzip2 − a block‐sorting file compressor, v1.0.7
bzip2, bunzip2 − a block‐sorting file compressor, v1.0.8
bzcat − decompresses files to stdout
bzip2recover − recovers data from damaged bzip2 files

Expand Down Expand Up @@ -348,7 +348,7 @@ CCAAVVEEAATTSS
but the details of what the problem is sometimes seem
rather misleading.

This manual page pertains to version 1.0.7 of _b_z_i_p_2_. Com­
This manual page pertains to version 1.0.8 of _b_z_i_p_2_. Com­
pressed data created by this version is entirely forwards
and backwards compatible with the previous public
releases, versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1,
Expand Down
20 changes: 10 additions & 10 deletions bzip2.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <[email protected]>
bzip2/libbzip2 version 1.0.8 of 13 July 2019
Copyright (C) 1996-2019 Julian Seward <[email protected]>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
Expand Down Expand Up @@ -128,12 +128,12 @@
#if BZ_LCCWIN32
# include <io.h>
# include <fcntl.h>
# include <sys\stat.h>
# include <sys/stat.h>

# define NORETURN /**/
# define PATH_SEP '\\'
# define MY_LSTAT _stat
# define MY_STAT _stat
# define MY_LSTAT _stati64
# define MY_STAT _stati64
# define MY_S_ISREG(x) ((x) & _S_IFREG)
# define MY_S_ISDIR(x) ((x) & _S_IFDIR)

Expand Down Expand Up @@ -748,8 +748,8 @@ void panic ( const Char* s )
fprintf ( stderr,
"\n%s: PANIC -- internal consistency error:\n"
"\t%s\n"
"\tThis is a BUG. Please report it to me at:\n"
"\tjseward@acm.org\n",
"\tThis is a BUG. Please report it to:\n"
"\tbzip2-devel@sourceware.org\n",
progName, s );
showFileNames();
cleanUpAndFail( 3 );
Expand Down Expand Up @@ -829,7 +829,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n )
" The user's manual, Section 4.3, has more info on (1) and (2).\n"
" \n"
" If you suspect this is a bug in bzip2, or are unsure about (1)\n"
" or (2), feel free to report it to me at: jseward@acm.org.\n"
" or (2), feel free to report it to: bzip2-devel@sourceware.org.\n"
" Section 4.3 of the user's manual describes the info a useful\n"
" bug report should have. If the manual is available on your\n"
" system, please try and read it before mailing me. If you don't\n"
Expand All @@ -852,7 +852,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n )
" The user's manual, Section 4.3, has more info on (2) and (3).\n"
" \n"
" If you suspect this is a bug in bzip2, or are unsure about (2)\n"
" or (3), feel free to report it to me at: jseward@acm.org.\n"
" or (3), feel free to report it to: bzip2-devel@sourceware.org.\n"
" Section 4.3 of the user's manual describes the info a useful\n"
" bug report should have. If the manual is available on your\n"
" system, please try and read it before mailing me. If you don't\n"
Expand Down Expand Up @@ -1605,7 +1605,7 @@ void license ( void )
"bzip2, a block-sorting file compressor. "
"Version %s.\n"
" \n"
" Copyright (C) 1996-2010 by Julian Seward.\n"
" Copyright (C) 1996-2019 by Julian Seward.\n"
" \n"
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms set out in the LICENSE file, which is included\n"
Expand Down
4 changes: 2 additions & 2 deletions bzip2.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

NAME
bzip2, bunzip2 - a block-sorting file compressor, v1.0.7
bzip2, bunzip2 - a block-sorting file compressor, v1.0.8
bzcat - decompresses files to stdout
bzip2recover - recovers data from damaged bzip2 files

Expand Down Expand Up @@ -345,7 +345,7 @@ CAVEATS
but the details of what the problem is sometimes seem
rather misleading.

This manual page pertains to version 1.0.7 of bzip2. Com-
This manual page pertains to version 1.0.8 of bzip2. Com-
pressed data created by this version is entirely forwards
and backwards compatible with the previous public
releases, versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1,
Expand Down
6 changes: 3 additions & 3 deletions bzip2recover.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <[email protected]>
bzip2/libbzip2 version 1.0.8 of 13 July 2019
Copyright (C) 1996-2019 Julian Seward <[email protected]>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
Expand Down Expand Up @@ -314,7 +314,7 @@ Int32 main ( Int32 argc, Char** argv )
inFileName[0] = outFileName[0] = 0;

fprintf ( stderr,
"bzip2recover 1.0.7: extracts blocks from damaged .bz2 files.\n" );
"bzip2recover 1.0.8: extracts blocks from damaged .bz2 files.\n" );

if (argc != 2) {
fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n",
Expand Down
Loading

0 comments on commit 8bc00ae

Please sign in to comment.