libtar.git
10 years agoFixed size_t overflow bug, as reported by Timo Warns
Chris Frey [Tue, 1 Oct 2013 19:58:52 +0000 (1 15:58 -0400)]
Fixed size_t overflow bug, as reported by Timo Warns

11 years agoAdded autoconf checks for __thread compiler support
Chris Frey [Fri, 29 Mar 2013 05:38:36 +0000 (29 01:38 -0400)]
Added autoconf checks for __thread compiler support

If the compiler does not support __thread or __declspec(thread)
as tested for in autoconf/ax_tls.m4, then libtar is not as threadsafe
as you may expect.

11 years agoFixed thread-safe bug in th_get_pathname()
Sergey Zhitomirsky [Fri, 29 Mar 2013 05:33:08 +0000 (29 01:33 -0400)]
Fixed thread-safe bug in th_get_pathname()

Current libtar breaks in multi-thread app, when reading more then 1
tar simultaneously in different threads, one thread may erroneously
receive the filename for the other thread due to returned static
variable.

This bug was was introduced with the patch with the name "Fix memory
leak in th_get_pathname", which removed strdup() from
th_get_pathname() and made filename static.

11 years agoAdded extern "C" protectors to listhash.h
Chris Frey [Mon, 4 Feb 2013 03:16:27 +0000 (3 22:16 -0500)]
Added extern "C" protectors to listhash.h

Thanks to Marcin Adamski for the report!

11 years agolibtar version 1.2.19v1.2.19
Chris Frey [Tue, 11 Dec 2012 23:29:59 +0000 (11 18:29 -0500)]
libtar version 1.2.19

11 years agoAdded const to char* function arguments where appropriate
Jan Cermak [Tue, 11 Dec 2012 22:41:49 +0000 (11 17:41 -0500)]
Added const to char* function arguments where appropriate

11 years agoChanged makedev() argument count test from AC_RUN_ to AC_COMPILE_
Chris Frey [Wed, 5 Sep 2012 19:43:02 +0000 (5 15:43 -0400)]
Changed makedev() argument count test from AC_RUN_ to AC_COMPILE_

See https://lists.feep.net:8080/pipermail/libtar/2012-September/000337.html
for the discussion that lead to this change.

11 years agoFixed gcc compiler built-in warnings
Chris Frey [Wed, 5 Sep 2012 19:26:02 +0000 (5 15:26 -0400)]
Fixed gcc compiler built-in warnings

../compat/snprintf.c:496: warning: conflicting types for built-in function 'pow10'
../compat/snprintf.c:509: warning: conflicting types for built-in function 'round'

11 years agoFixed short int / int compiler warnings in va_arg() usage
Chris Frey [Wed, 5 Sep 2012 19:25:16 +0000 (5 15:25 -0400)]
Fixed short int / int compiler warnings in va_arg() usage

Compiler warned:

../compat/snprintf.c:232: warning: 'short int' is promoted to 'int' when passed through '...'
../compat/snprintf.c:232: note: (so you should pass 'int' not 'short int' to 'va_arg')
../compat/snprintf.c:232: note: if this code is reached, the program will abort

11 years agoRemoved varargs.h and all dependencies on it
Chris Frey [Wed, 5 Sep 2012 19:23:49 +0000 (5 15:23 -0400)]
Removed varargs.h and all dependencies on it

Even configure itself assumes stdarg.h by now in its own tests, at least
on my system, so don't bother with the extra checks anymore, since they
are causing trouble during user compiles.

11 years agolibtar version 1.2.18v1.2.18
Chris Frey [Thu, 2 Aug 2012 20:43:39 +0000 (2 16:43 -0400)]
libtar version 1.2.18

Note: If your application uses the macro th_crc_ok(), then to gain full
advantage of the changes in this version, you will need to recompile
your application against the new headers.  Otherwise, the library is
drop-in replaceable, as usual.

11 years agoAdded more forgiving CRC checking logic when reading tar files
Chris Frey [Tue, 31 Jul 2012 21:12:36 +0000 (31 17:12 -0400)]
Added more forgiving CRC checking logic when reading tar files

Tim Kientzle posted the following to the libtar mailing list regarding
the earlier CRC bug:

This exact bug has reappeared many times in different
tar implementations.  Here are two suggestions:

* The standards specify that the checksum is
calculated using unsigned characters.

* The most robust tar readers will compute the
checksum both ways (with unsigned characters and
with signed characters) and accept the header
if either version matches.

https://lists.feep.net:8080/pipermail/libtar/2012-July/000327.html

He gave the following links:

http://pubs.opengroup.org/onlinepubs/9699919799/

"pax" is under "Shell & Utilities" => "Utilities"; here's
a direct link:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html
https://github.com/libarchive/libarchive/wiki/ManPageTar5

This commit turns libtar into a "more robust tar reader."

11 years agolibtar version 1.2.17v1.2.17
Chris Frey [Tue, 24 Jul 2012 21:06:43 +0000 (24 17:06 -0400)]
libtar version 1.2.17

11 years agoFixed checksum calculation in writing header
Tim Band [Mon, 23 Jul 2012 18:40:40 +0000 (23 19:40 +0100)]
Fixed checksum calculation in writing header

Calculation used signed char instead of unsigned char.
Fixed it by calling the same routine used in reading and checking.

11 years agolibtar version 1.2.16v1.2.16
Chris Frey [Thu, 17 May 2012 07:34:32 +0000 (17 03:34 -0400)]
libtar version 1.2.16

11 years agoFixed build system to allow for out-of-source tree builds
Chris Frey [Thu, 17 May 2012 07:31:12 +0000 (17 03:31 -0400)]
Fixed build system to allow for out-of-source tree builds

When using configure from a directory other than the top level source
tree, there was trouble compiling the compat/ and listhash/ libraries.
Two minor path fixes changed that.

12 years agolibtar version 1.2.15v1.2.15
Chris Frey [Thu, 10 May 2012 05:14:18 +0000 (10 01:14 -0400)]
libtar version 1.2.15

12 years agoFixed harmless buffer overflow which is caught by FORTIFY on some systems
Chris Frey [Thu, 10 May 2012 05:08:07 +0000 (10 01:08 -0400)]
Fixed harmless buffer overflow which is caught by FORTIFY on some systems

encode.c takes a shortcut, and updates two struct fields with one
strncpy() call.  This commit splits it into two calls.

12 years agolibtar version 1.2.14v1.2.14
Chris Frey [Thu, 22 Dec 2011 22:13:36 +0000 (22 17:13 -0500)]
libtar version 1.2.14

12 years agoFixed truncation check, so 100 char names get GNU extension support when enabled
Chris Frey [Thu, 22 Dec 2011 22:08:28 +0000 (22 17:08 -0500)]
Fixed truncation check, so 100 char names get GNU extension support when enabled

Reported by Barrie Walker as follows:

I've experienced a problem with 1.2.11 where a name or link is exactly
100 characters.

When not using TAR_GNU name/linknames longer than 99 characters are
simply truncated to 99 characters (+1 for the NUL makes T_NAMELEN (=
100)). Any overflow is lost - fair enough.

Using TAR_GNU, name/linknames longer than 99 characters are still
truncated to 99 characters but the full string is placed in the
gnu_longname/gnu_longlink fields.
However the gnu_longname/gnu_longlink fields are populated only when a
name/linkname would be truncated.

The bug is that the check to see whether there will be truncation
compares the length against T_NAMELEN rather than T_NAMELEN-1.

The fix is simply, in lines 85 and 123 of encode.c, to change T_NAMELEN
to T_NAMELEN-1.

12 years agolibtar version 1.2.13v1.2.13
Chris Frey [Mon, 13 Jun 2011 22:21:35 +0000 (13 18:21 -0400)]
libtar version 1.2.13

12 years agoReduce memory used by libtar when extracting files.
Per Lidén [Mon, 13 Jun 2011 21:51:37 +0000 (13 17:51 -0400)]
Reduce memory used by libtar when extracting files.

The patch below drastically reduces the amount of memory used by libtar
when extracting files. For each extracted file a 8K struct (MAXPATHLEN is
4096 in Linux) is allocated and inserted in the hashtable for hardlink
mapping. However, in the normal case only a tiny part of those 8K is used.
The patch below calculates the size and allocates no more memory than
needed.

When I unpacked a tar with ~550 files, the memory consumption for the
hashtable went from about 4Mb down to about 200Kb.

/Per

https://lists.feep.net:8080/pipermail/libtar/2003-October/000162.html

12 years agoFix memory leak in th_get_pathname
Per Lidén [Mon, 13 Jun 2011 21:46:05 +0000 (13 17:46 -0400)]
Fix memory leak in th_get_pathname

Fix memory leak in th_get_pathname by making the buffer, where prefix
and filename are concatenated, static and returning that instead of a
pointer to a copy of a local buffer.

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libtar/+bug/41804
https://lists.feep.net:8080/pipermail/libtar/2003-October/000161.html

12 years agoEscape hyphens that should be minus signs in man pages.
Magnus Holmgren [Mon, 13 Jun 2011 21:35:50 +0000 (13 17:35 -0400)]
Escape hyphens that should be minus signs in man pages.

12 years agoUse libtool to build dynamic library
Glenn McGrath [Mon, 13 Jun 2011 21:31:57 +0000 (13 17:31 -0400)]
Use libtool to build dynamic library

12 years agoChanged root Makefile.in to Makefile.am, which make autoreconf workable
Chris Frey [Mon, 13 Jun 2011 21:23:58 +0000 (13 17:23 -0400)]
Changed root Makefile.in to Makefile.am, which make autoreconf workable

Running autoreconf without errors, and using a custom autoconf directory,
means that automake features are used, in order to find that autoconf
directory.  This cleans up the root build system to make it less
surprising to maintainers.

12 years agoDocument stupidity of tartype_t in libtar.c.
James Morrison [Mon, 6 Jun 2011 22:40:06 +0000 (6 18:40 -0400)]
Document stupidity of tartype_t in libtar.c.

Bug-Debian: http://bugs.debian.org/309945

(Patch taken from Debian packaging by Chris Frey, and editied slightly
to remove extra header include.)

15 years agoApplied Marcin Gibula's patch fixing tar_extract_glob()
Chris Frey [Sat, 2 May 2009 05:23:57 +0000 (2 01:23 -0400)]
Applied Marcin Gibula's patch fixing tar_extract_glob()

https://lists.feep.net:8080/pipermail/libtar/2003-September/000160.html

15 years agoFixed header warnings
Chris Frey [Sat, 2 May 2009 04:03:33 +0000 (2 00:03 -0400)]
Fixed header warnings

15 years agoAdded datarootdir to Makefile.in's
Chris Frey [Sat, 2 May 2009 03:57:00 +0000 (1 23:57 -0400)]
Added datarootdir to Makefile.in's

15 years agoRemoved auto-generated files
Chris Frey [Wed, 29 Apr 2009 08:44:29 +0000 (29 04:44 -0400)]
Removed auto-generated files

15 years agoRemoved m4 includes, and straightened out [] m4 quoting for modern autoconfs
Chris Frey [Sat, 2 May 2009 03:36:44 +0000 (1 23:36 -0400)]
Removed m4 includes, and straightened out [] m4 quoting for modern autoconfs

15 years agoRenamed autoconf/aclocal.m4 to psg.m4 so aclocal isn't so confused
Chris Frey [Sat, 2 May 2009 03:36:06 +0000 (1 23:36 -0400)]
Renamed autoconf/aclocal.m4 to psg.m4 so aclocal isn't so confused

15 years agoAdded autogen.sh script to build a fresh configure
Chris Frey [Sat, 2 May 2009 03:18:48 +0000 (1 23:18 -0400)]
Added autogen.sh script to build a fresh configure

15 years agoAdded autoconf/ as macro dir
Chris Frey [Sat, 2 May 2009 03:02:45 +0000 (1 23:02 -0400)]
Added autoconf/ as macro dir

15 years agoFixed incorrect URL in readme
Chris Frey [Tue, 28 Apr 2009 20:39:21 +0000 (28 16:39 -0400)]
Fixed incorrect URL in readme

Patch from Joni Yrjänä
https://lists.feep.net:8080/pipermail/libtar/2006-July/000228.html

15 years agolibtar-1.2.11 tarball sources, taken from Debian's orig tarv1.2.11
Chris Frey [Tue, 28 Apr 2009 20:35:00 +0000 (28 16:35 -0400)]
libtar-1.2.11 tarball sources, taken from Debian's orig tar

The main site, feep.net, has a broken ftp link, so can't download
tarball from there.