Subversion Repositories libtar

Compare Revisions

Ignore whitespace Rev 33 → Rev 42

/tags/1.2.20-5/debian/changelog
1,3 → 1,25
libtar (1.2.20-5) unstable; urgency=low
 
* oldgnu_prefix.patch: Detect old-style GNU headers correctly (Closes:
#763119). Those appear in incremental archives and use the bytes that
the new-style headers use for the prefix field for other fields.
Thanks to Steinar H. Gunderson.
* testsuite.patch: Add a simple test (Closes: #737258).
* Bump Standards-Version to 3.9.7.
 
-- Magnus Holmgren <holmgren@debian.org> Fri, 25 Mar 2016 19:12:23 +0100
 
libtar (1.2.20-4) unstable; urgency=high
 
* no_maxpathlen.patch: Half of the part of the patch modifying
compat/dirname.c was missing, causing libtar's dirname to always
return NULL (except in special circumstances). Actually make it work
(Closes: #745352). (The reason that libtar doesn't use libc's
dirname() and basename() on some or most platforms is that the code
doesn't work with destructive versions of these functions).
 
-- Magnus Holmgren <holmgren@debian.org> Sat, 03 May 2014 20:39:02 +0200
 
libtar (1.2.20-3) unstable; urgency=low
 
* no_maxpathlen.patch: Fix two grave bugs in the patch. First,
/tags/1.2.20-5/debian/control
4,7 → 4,7
Maintainer: Magnus Holmgren <holmgren@debian.org>
Build-Depends: dpkg-dev (>= 1.15.7), debhelper (>= 7), dh-autoreconf,
autoconf, libtool
Standards-Version: 3.9.5
Standards-Version: 3.9.7
Homepage: http://www.feep.net/libtar/
Vcs-Browser: http://svn.kibibyte.se/libtar
Vcs-Svn: svn://svn.kibibyte.se/libtar/trunk
/tags/1.2.20-5/debian/patches/no_maxpathlen.patch
88,6 → 88,31
/* Empty or NULL string gets treated as "." */
if (path == NULL || *path == '\0') {
@@ -67,11 +79,19 @@ openbsd_dirname(path)
} while (endp > path && *endp == '/');
}
- if (endp - path + 1 > sizeof(bname)) {
- errno = ENAMETOOLONG;
- return(NULL);
+ len = endp - path + 1;
+
+ if (len + 1 > allocated) {
+ size_t new_allocated = 2*(len+1);
+ void *new_bname = malloc(new_allocated);
+ if (!new_bname)
+ return NULL;
+ allocated = new_allocated;
+ free(bname);
+ bname = new_bname;
}
- (void)strncpy(bname, path, endp - path + 1);
- bname[endp - path + 1] = '\0';
+
+ (void)strncpy(bname, path, len);
+ bname[len] = '\0';
return(bname);
}
--- a/lib/append.c
+++ b/lib/append.c
@@ -38,7 +38,7 @@ typedef struct tar_dev tar_dev_t;
/tags/1.2.20-5/debian/patches/oldgnu_prefix.patch
0,0 → 1,21
Description: Detect old-style GNU headers correctly
Author: Steinar H. Gunderson <sesse@debian.org>
 
--- libtar-1.2.20.orig/lib/decode.c
+++ libtar-1.2.20/lib/decode.c
@@ -69,7 +69,14 @@ th_get_pathname(TAR *t)
return NULL;
}
- if (t->th_buf.prefix[0] == '\0')
+ /*
+ * Old GNU headers (also used by newer GNU tar when doing incremental
+ * dumps) use the POSIX prefix field for many other things, such as
+ * mtime and ctime. New-style GNU headers don't, but also don't use the
+ * POSIX prefix field. Thus, only honor the prefix field if the archive
+ * is actually a POSIX archive. This is the same logic as GNU tar uses.
+ */
+ if (strncmp(t->th_buf.magic, TMAGIC, TMAGLEN - 1) != 0 || t->th_buf.prefix[0] == '\0')
{
sprintf(t->th_pathname, "%.100s", t->th_buf.name);
}
/tags/1.2.20-5/debian/patches/series
2,3 → 2,5
no_maxpathlen.patch
CVE-2013-4420.patch
th_get_size-unsigned-int.patch
oldgnu_prefix.patch
testsuite.patch
/tags/1.2.20-5/debian/patches/testsuite.patch
0,0 → 1,50
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,5 +10,5 @@ ACLOCAL_AMFLAGS = -I autoconf
#@SET_MAKE@
-SUBDIRS = lib libtar doc
+SUBDIRS = lib libtar doc testsuite
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -151,3 +151,4 @@ install: all
echo ".so man3/@LISTHASH_PREFIX@_list_new.3" > ${DESTDIR}${mandir}/man3/$${i}.3; \
done
+check:
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -104,3 +104,4 @@ install: ${ALL}
${INSTALL_DATA} ${srcdir}/libtar.h ${DESTDIR}${includedir}
${INSTALL_DATA} ../listhash/libtar_listhash.h ${DESTDIR}${includedir}
+check:
--- a/libtar/Makefile.in
+++ b/libtar/Makefile.in
@@ -76,3 +76,4 @@ install: ${ALL}
${MKDIR} ${DESTDIR}${bindir}
$(LIBTOOL) --mode=install ${INSTALL_PROGRAM} libtar ${DESTDIR}${bindir}
+check:
--- /dev/null
+++ b/testsuite/Makefile.in
@@ -0,0 +1,7 @@
+all:
+
+check: ../libtar/libtar
+ ../libtar/libtar -C ../doc -c test.tar .
+ ../libtar/libtar -t test.tar
+ $(RM) test.tar
+install:
--- a/configure.ac
+++ b/configure.ac
@@ -120,6 +120,6 @@ fi
dnl ### Create output files. #######################################
-AC_CONFIG_FILES([Makefile lib/Makefile libtar/Makefile doc/Makefile])
+AC_CONFIG_FILES([Makefile lib/Makefile libtar/Makefile doc/Makefile testsuite/Makefile])
AC_OUTPUT
/tags/1.2.20-5/debian/rules
8,6 → 8,7
[ -f debian/autoreconf.before ] || dh_autoreconf
./configure \
--prefix=/usr \
--without-zlib \
--mandir=\$${prefix}/share/man \
$(shell dpkg-buildflags --export=configure)
touch configure-stamp
20,6 → 21,10
$(MAKE)
touch build-stamp
 
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
$(MAKE) check
endif
 
clean:
dh_testdir
dh_testroot