[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#756462: marked as done (busybox: Update deb format support)

Your message dated Sun, 03 Aug 2014 10:33:38 +0000
with message-id <E1XDt6g-0005Ur-Rt@franck.debian.org>
and subject line Bug#756462: fixed in busybox 1:1.22.0-7
has caused the Debian Bug report #756462,
regarding busybox: Update deb format support
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org

756462: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=756462
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: busybox
Version: 1:1.22.0-6
Severity: wishlist
Tags: patch


As part of an effort [S] to try to get as much tools to understand
the current .deb format (see deb(5)), I'm attaching a patch updating
the busybox dpkg and dpkg-deb applets against that spec.

 [S] <https://wiki.debian.org/Teams/Dpkg/DebSupport>

As those applets are only built for the busybox-static package, I've
tested that one against the test packages from the dpkg/pkg-tests.git
repository [T], which can be found in the t-deb-format directory.

  [T] <git://anonscm.debian.org/dpkg/pkg-tests.git>

I only found an issue with a control.tar.xz member, and the dpkg-deb
applet that prints a corrupted data error, but outputs the entire
control file correctly, and extracts it also correctly, so I think
this is an issue with the existing xz decoder in busybox, and as a
wild guess probably from the 0 padding in the tar archive. Here's an
excerpt from the session:

$ dpkg-deb -I pkg-control-xz.deb
 new debian package, version 2.0.
 size 744 bytes: control archive=348 bytes.
     193 bytes,     7 lines      control
 Package: pkg-deb-format
 Version: 0.0-1
 Section: test
 Priority: extra
 Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
 Architecture: all
 Description: test package - deb format support
$ busybox dpkg-deb -f pkg-control-xz.deb 
Package: pkg-deb-format
Version: 0.0-1
Section: test
Priority: extra
Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
Architecture: all
Description: test package - deb format support
dpkg-deb: corrupted data
$ busybox dpkg-deb -e pkg-control-xz.deb DEBIAN
dpkg-deb: corrupted data
$ ls -l  DEBIAN/
total 4
-rw-r--r-- 1 guillem guillem 193 Jul 30 04:27 control

Description: Add support for latest .deb format members
 This adds support for control.tar, control.tar.xz, data.tar, data.tar.xz
 and data.tar.lzma in the dpkg and dpkg-deb applet. It also removes support
 for control.tar.bz2 which has never been supported.
 This should make these applets conform to deb(5).
Author: Guillem Jover <guillem@debian.org>
Origin: vendor
Forwarded: no
Last-Update: 2014-07-30

diff --git a/archival/dpkg.c b/archival/dpkg.c
index 2893cfc..71eae66 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -1472,11 +1472,12 @@ static void init_archive_deb_control(archive_handle_t *ar_handle)
 	tar_handle->src_fd = ar_handle->src_fd;
 	/* We don't care about data.tar.* or debian-binary, just control.tar.* */
+	llist_add_to(&(ar_handle->accept), (char*)"control.tar");
 	llist_add_to(&(ar_handle->accept), (char*)"control.tar.gz");
-	llist_add_to(&(ar_handle->accept), (char*)"control.tar.bz2");
+	llist_add_to(&(ar_handle->accept), (char*)"control.tar.xz");
 	/* Assign the tar handle as a subarchive of the ar handle */
@@ -1492,12 +1493,19 @@ static void init_archive_deb_data(archive_handle_t *ar_handle)
 	tar_handle->src_fd = ar_handle->src_fd;
 	/* We don't care about control.tar.* or debian-binary, just data.tar.* */
+	llist_add_to(&(ar_handle->accept), (char*)"data.tar");
 	llist_add_to(&(ar_handle->accept), (char*)"data.tar.gz");
+	llist_add_to(&(ar_handle->accept), (char*)"data.tar.xz");
 	llist_add_to(&(ar_handle->accept), (char*)"data.tar.bz2");
+	llist_add_to(&(ar_handle->accept), (char*)"data.tar.lzma");
 	/* Assign the tar handle as a subarchive of the ar handle */
 	ar_handle->dpkg__sub_archive = tar_handle;
diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c
index 13f9db9..48920f6 100644
--- a/archival/dpkg_deb.c
+++ b/archival/dpkg_deb.c
@@ -70,10 +70,16 @@ int dpkg_deb_main(int argc, char **argv)
 	ar_archive->dpkg__sub_archive = tar_archive;
 	ar_archive->filter = filter_accept_list_reassign;
+	llist_add_to(&ar_archive->accept, (char*)"data.tar");
+	llist_add_to(&control_tar_llist, (char*)"control.tar");
 	llist_add_to(&ar_archive->accept, (char*)"data.tar.gz");
 	llist_add_to(&control_tar_llist, (char*)"control.tar.gz");
+	llist_add_to(&ar_archive->accept, (char*)"data.tar.xz");
+	llist_add_to(&control_tar_llist, (char*)"control.tar.xz");
 	llist_add_to(&ar_archive->accept, (char*)"data.tar.bz2");
 	llist_add_to(&control_tar_llist, (char*)"control.tar.bz2");
diff --git a/archival/libarchive/Kbuild.src b/archival/libarchive/Kbuild.src
index 968fdf8..fda05d8 100644
--- a/archival/libarchive/Kbuild.src
+++ b/archival/libarchive/Kbuild.src
@@ -33,6 +33,7 @@ DPKG_FILES:= \
 	get_header_ar.o \
 	get_header_tar.o \
 	get_header_tar_gz.o \
+	get_header_tar_xz.o \
 	get_header_tar_bz2.o \
 	get_header_tar_lzma.o \
diff --git a/archival/libarchive/filter_accept_list_reassign.c b/archival/libarchive/filter_accept_list_reassign.c
index 3d19abe..bcfeb96 100644
--- a/archival/libarchive/filter_accept_list_reassign.c
+++ b/archival/libarchive/filter_accept_list_reassign.c
@@ -28,12 +28,23 @@ char FAST_FUNC filter_accept_list_reassign(archive_handle_t *archive_handle)
 		/* Modify the subarchive handler based on the extension */
+		if (strcmp(name_ptr, "tar") == 0
+		) {
+			archive_handle->dpkg__action_data_subarchive = get_header_tar;
+			return EXIT_SUCCESS;
+		}
 		 && strcmp(name_ptr, "gz") == 0
 		) {
 			archive_handle->dpkg__action_data_subarchive = get_header_tar_gz;
 			return EXIT_SUCCESS;
+		 && strcmp(name_ptr, "xz") == 0
+		) {
+			archive_handle->dpkg__action_data_subarchive = get_header_tar_xz;
+			return EXIT_SUCCESS;
+		}
 		 && strcmp(name_ptr, "bz2") == 0
 		) {
diff --git a/archival/libarchive/get_header_tar_xz.c b/archival/libarchive/get_header_tar_xz.c
new file mode 100644
index 0000000..30ac522
--- /dev/null
+++ b/archival/libarchive/get_header_tar_xz.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+#include "libbb.h"
+#include "bb_archive.h"
+char FAST_FUNC get_header_tar_xz(archive_handle_t *archive_handle)
+	/* Can't lseek over pipes */
+	archive_handle->seek = seek_by_read;
+	open_transformer_with_sig(archive_handle->src_fd, unpack_xz_stream, "unxz");
+	archive_handle->offset = 0;
+	while (get_header_tar(archive_handle) == EXIT_SUCCESS)
+		continue;
+	/* Can only do one file at a time */
+	return EXIT_FAILURE;
diff --git a/include/bb_archive.h b/include/bb_archive.h
index b82cfd8..a356f70 100644
--- a/include/bb_archive.h
+++ b/include/bb_archive.h
@@ -182,6 +182,7 @@ char get_header_ar(archive_handle_t *archive_handle) FAST_FUNC;
 char get_header_cpio(archive_handle_t *archive_handle) FAST_FUNC;
 char get_header_tar(archive_handle_t *archive_handle) FAST_FUNC;
 char get_header_tar_gz(archive_handle_t *archive_handle) FAST_FUNC;
+char get_header_tar_xz(archive_handle_t *archive_handle) FAST_FUNC;
 char get_header_tar_bz2(archive_handle_t *archive_handle) FAST_FUNC;
 char get_header_tar_lzma(archive_handle_t *archive_handle) FAST_FUNC;

--- End Message ---
--- Begin Message ---
Source: busybox
Source-Version: 1:1.22.0-7

We believe that the bug you reported is fixed in the latest version of
busybox, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 756462@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
Christian Perrier <bubulle@debian.org> (supplier of updated busybox package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)

Hash: SHA1

Format: 1.8
Date: Sun, 03 Aug 2014 09:22:14 +0200
Source: busybox
Binary: busybox busybox-static busybox-udeb busybox-syslogd udhcpc udhcpd
Architecture: source i386 all
Version: 1:1.22.0-7
Distribution: unstable
Urgency: low
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Christian Perrier <bubulle@debian.org>
 busybox    - Tiny utilities for small and embedded systems
 busybox-static - Standalone rescue shell with tons of builtin utilities
 busybox-syslogd - Provides syslogd and klogd using busybox
 busybox-udeb - Tiny utilities for the debian-installer (udeb)
 udhcpc     - Provides the busybox DHCP client implementation
 udhcpd     - Provides the busybox DHCP server implementation
Closes: 756462
 busybox (1:1.22.0-7) unstable; urgency=low
   * Team upload
   [ Guillem Jover ]
   * Update deb format support. Closes: #756462
   [ Christian Perrier ]
   * Add gbp.conf to build the package automatically with git-
   * Source /lib/lsb/init-functions in udhcpd init script
 1b9d6821418dc12e5b56dc9eace057965ac578e4 2204 busybox_1.22.0-7.dsc
 486fb55c3efa71148fe07895fd713ea3a5ae343a 2218120 busybox_1.22.0.orig.tar.bz2
 08dac15c8834e6886f476128447ed3debbb3e130 50584 busybox_1.22.0-7.debian.tar.xz
 bdafa4dc3c4e5293ae4c19a1703a9a3363aba3e7 362606 busybox_1.22.0-7_i386.deb
 d533d6c88a512fcc79055c34fbaeffadf929f82b 766152 busybox-static_1.22.0-7_i386.deb
 60f651aee4e9e294182793f9aaf3f5ff597fba6f 159260 busybox-udeb_1.22.0-7_i386.udeb
 44a403f599ebfd6a0ae3dcac771ca6be92f5e097 22646 busybox-syslogd_1.22.0-7_all.deb
 a072edf58d2b4606032696127073ff310650eee5 20426 udhcpc_1.22.0-7_i386.deb
 1107d663bb755e153469480a30da2ab375a2cd81 23494 udhcpd_1.22.0-7_i386.deb
 159295003cf8418e1e7286142be123a042bf0f6658756d17353b2f04cf04ecf2 2204 busybox_1.22.0-7.dsc
 92f00cd391b7d5fa2215c8450abe2ba15f9d16c226e8855fb21b6c9a5b723a53 2218120 busybox_1.22.0.orig.tar.bz2
 3f930d9014b3926c379f6cb74316cad1408218c556569c3bc7d30761ebebdcea 50584 busybox_1.22.0-7.debian.tar.xz
 3d62f7bf95ced4009cf4e81d20b205c9d7bcf1ba2318b1aabf7b66f98060b5e4 362606 busybox_1.22.0-7_i386.deb
 f2166140b705e55e3a3490713a7502f3a348d066e88607e2648bc9fc0b71e5d6 766152 busybox-static_1.22.0-7_i386.deb
 cad56c1c4187ea38f3ad43136d0697a672958b6c29009e9039aab7043d76612e 159260 busybox-udeb_1.22.0-7_i386.udeb
 1eea581f4b5f07e2e0c94cefc00e83081bba22d75be12ccce15ccae3164e2424 22646 busybox-syslogd_1.22.0-7_all.deb
 643e0e37e62b1e14e9acbe3231edf298f2a3ba5755fc99db71fbd05838069144 20426 udhcpc_1.22.0-7_i386.deb
 2048d0bce8b10705dc967b4430103d98925746919017581b28865dc32e1ae9f0 23494 udhcpd_1.22.0-7_i386.deb
 3ec15a13e713669bcf9cef42043beeb1 362606 utils optional busybox_1.22.0-7_i386.deb
 3844c2bd7a028e6260a4fad8a986535c 766152 shells extra busybox-static_1.22.0-7_i386.deb
 fc8f8926f0b6225d5c826dd2188c946b 159260 debian-installer extra busybox-udeb_1.22.0-7_i386.udeb
 3e457ef62000c7d2a128face8ad73e74 22646 utils optional busybox-syslogd_1.22.0-7_all.deb
 b72e25ab9541022b8b4c72bbd0a018b6 20426 net optional udhcpc_1.22.0-7_i386.deb
 84da9768062ab2ab6412f3d512fc1304 23494 net optional udhcpd_1.22.0-7_i386.deb
 332a931db1dd1212a252d3ab9d964d21 2204 utils optional busybox_1.22.0-7.dsc
 ac1881d1cdeb0729b22c663feaf1c663 2218120 utils optional busybox_1.22.0.orig.tar.bz2
 ac5d11116202090a320f9b052ae0b5e3 50584 utils optional busybox_1.22.0-7.debian.tar.xz

Version: GnuPG v1.4.12 (GNU/Linux)


--- End Message ---

Reply to: