diff -Nru libtar-1.2.20/debian/changelog libtar-1.2.20/debian/changelog --- libtar-1.2.20/debian/changelog 2014-02-15 22:52:19.000000000 +0000 +++ libtar-1.2.20/debian/changelog 2014-06-19 23:22:35.000000000 +0000 @@ -1,3 +1,15 @@ +libtar (1.2.20-3ubuntu0.1) trusty-proposed; urgency=high + + [ Magnus Holmgren ] + * 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). (LP: #1315742) + + -- Brian Murray Thu, 19 Jun 2014 11:44:33 -0700 + libtar (1.2.20-3) unstable; urgency=low * no_maxpathlen.patch: Fix two grave bugs in the patch. First, diff -Nru libtar-1.2.20/debian/control libtar-1.2.20/debian/control --- libtar-1.2.20/debian/control 2014-02-15 20:49:46.000000000 +0000 +++ libtar-1.2.20/debian/control 2014-06-19 18:45:15.000000000 +0000 @@ -1,7 +1,8 @@ Source: libtar Section: libs Priority: optional -Maintainer: Magnus Holmgren +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Magnus Holmgren Build-Depends: dpkg-dev (>= 1.15.7), debhelper (>= 7), dh-autoreconf, autoconf, libtool Standards-Version: 3.9.5 diff -Nru libtar-1.2.20/debian/patches/no_maxpathlen.patch libtar-1.2.20/debian/patches/no_maxpathlen.patch --- libtar-1.2.20/debian/patches/no_maxpathlen.patch 2014-02-15 22:34:42.000000000 +0000 +++ libtar-1.2.20/debian/patches/no_maxpathlen.patch 2014-05-03 18:39:22.000000000 +0000 @@ -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;