diff -Nru dpkg-1.17.5ubuntu5.7/debian/changelog dpkg-1.17.5ubuntu5.8/debian/changelog --- dpkg-1.17.5ubuntu5.7/debian/changelog 2016-06-14 18:31:28.000000000 +0000 +++ dpkg-1.17.5ubuntu5.8/debian/changelog 2017-12-04 19:15:45.000000000 +0000 @@ -1,3 +1,10 @@ +dpkg (1.17.5ubuntu5.8) trusty; urgency=medium + + * Add support for .deb archives with a control member not compressed + (control.tar) or compressed with xz (control.tar.xz) LP: #1730627. + + -- Adam Conrad Mon, 04 Dec 2017 12:15:45 -0700 + dpkg (1.17.5ubuntu5.7) trusty; urgency=medium * Backport from Debian (LP: #1587667): diff -Nru dpkg-1.17.5ubuntu5.7/dpkg-deb/build.c dpkg-1.17.5ubuntu5.8/dpkg-deb/build.c --- dpkg-1.17.5ubuntu5.7/dpkg-deb/build.c 2013-12-10 06:15:02.000000000 +0000 +++ dpkg-1.17.5ubuntu5.8/dpkg-deb/build.c 2017-12-04 19:15:31.000000000 +0000 @@ -558,10 +558,14 @@ debar, err.str); } else if (deb_format.major == 2) { const char deb_magic[] = ARCHIVEVERSION "\n"; + char adminmember[16 + 1]; + + sprintf(adminmember, "%s%s", ADMINMEMBER, + compressor_get_extension(compressor_type_gzip)); dpkg_ar_put_magic(debar, arfd); dpkg_ar_member_put_mem(debar, arfd, DEBMAGIC, deb_magic, strlen(deb_magic)); - dpkg_ar_member_put_file(debar, arfd, ADMINMEMBER, gzfd, -1); + dpkg_ar_member_put_file(debar, arfd, adminmember, gzfd, -1); } else { internerr("unknown deb format version %d.%d", deb_format.major, deb_format.minor); } diff -Nru dpkg-1.17.5ubuntu5.7/dpkg-deb/dpkg-deb.h dpkg-1.17.5ubuntu5.8/dpkg-deb/dpkg-deb.h --- dpkg-1.17.5ubuntu5.7/dpkg-deb/dpkg-deb.h 2013-12-10 06:14:22.000000000 +0000 +++ dpkg-1.17.5ubuntu5.8/dpkg-deb/dpkg-deb.h 2017-12-04 19:15:31.000000000 +0000 @@ -70,7 +70,7 @@ #define OLDOLDDEBDIR ".DEBIAN" #define DEBMAGIC "debian-binary" -#define ADMINMEMBER "control.tar.gz" +#define ADMINMEMBER "control.tar" #define DATAMEMBER "data.tar" #define MAXFILENAME 2048 diff -Nru dpkg-1.17.5ubuntu5.7/dpkg-deb/extract.c dpkg-1.17.5ubuntu5.8/dpkg-deb/extract.c --- dpkg-1.17.5ubuntu5.7/dpkg-deb/extract.c 2015-11-26 12:57:29.000000000 +0000 +++ dpkg-1.17.5ubuntu5.8/dpkg-deb/extract.c 2017-12-04 19:15:31.000000000 +0000 @@ -178,9 +178,18 @@ if (fd_skip(arfd, memberlen + (memberlen & 1), &err) < 0) ohshit(_("cannot skip archive member from '%s': %s"), debar, err.str); } else { - if (strncmp(arh.ar_name, ADMINMEMBER, sizeof(arh.ar_name)) == 0) + if (strncmp(arh.ar_name, ADMINMEMBER, strlen(ADMINMEMBER)) == 0) { + const char *extension = arh.ar_name + strlen(ADMINMEMBER); + adminmember = 1; - else { + decompressor = compressor_find_by_extension(extension); + if (decompressor != compressor_type_none && + decompressor != compressor_type_gzip && + decompressor != compressor_type_xz) + ohshit(_("archive '%s' uses unknown compression for member '%.*s', " + "giving up"), + debar, (int)sizeof(arh.ar_name), arh.ar_name); + } else { if (adminmember != 1) ohshit(_("archive '%s' has premature member '%.*s' before '%s', " "giving up"), diff -Nru dpkg-1.17.5ubuntu5.7/man/deb.5 dpkg-1.17.5ubuntu5.8/man/deb.5 --- dpkg-1.17.5ubuntu5.7/man/deb.5 2013-12-10 06:14:22.000000000 +0000 +++ dpkg-1.17.5ubuntu5.8/man/deb.5 2017-12-04 19:15:31.000000000 +0000 @@ -66,8 +66,11 @@ in the archive (except at the end), as described below. .PP The second required member is named -.BR control.tar.gz . -It is a gzipped tar archive containing the package control information, +.BR control.tar . +It is a tar archive containing the package control information, either +not compressed (supported since dpkg 1.17.6), or compressed with +gzip (with \fB.gz\fP extension) or +xz (with \fB.xz\fP extension, supported since 1.17.6), as a series of plain files, of which the file .B control is mandatory and contains the core control information. The control