diff options
author | Rob Landley | 2005-08-13 00:46:00 +0000 |
---|---|---|
committer | Rob Landley | 2005-08-13 00:46:00 +0000 |
commit | 6022fc8723c4bfaf055011db33f69565fa0c82b1 (patch) | |
tree | f37b984e249247f2bdf6679e8b01158afcb56e16 /busybox/archival | |
parent | fc455b2101edbf97331384831de2989ce9cdb731 (diff) | |
download | busybox-6022fc8723c4bfaf055011db33f69565fa0c82b1.zip busybox-6022fc8723c4bfaf055011db33f69565fa0c82b1.tar.gz |
Backport:
10882 tar fix
10884, 10920, 11128 tail fixes
10885 tftp -g fix
10900 dpkg fix (script support)
And I guess 10918 isn't relevant?
Diffstat (limited to 'busybox/archival')
-rw-r--r-- | busybox/archival/dpkg.c | 2 | ||||
-rw-r--r-- | busybox/archival/libunarchive/get_header_tar.c | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/busybox/archival/dpkg.c b/busybox/archival/dpkg.c index d3b56e3..6a81029 100644 --- a/busybox/archival/dpkg.c +++ b/busybox/archival/dpkg.c @@ -1520,6 +1520,7 @@ static char *deb_extract_control_file_to_buffer(archive_handle_t *ar_handle, lli { ar_handle->sub_archive->action_data = data_extract_to_buffer; ar_handle->sub_archive->accept = myaccept; + ar_handle->sub_archive->filter = filter_accept_list; unpack_ar_archive(ar_handle); close(ar_handle->src_fd); @@ -1714,6 +1715,7 @@ int dpkg_main(int argc, char **argv) if (package_num == -1) { bb_error_msg("Invalid control file in %s", argv[optind]); + optind++; continue; } deb_file[deb_count]->package = (unsigned int) package_num; diff --git a/busybox/archival/libunarchive/get_header_tar.c b/busybox/archival/libunarchive/get_header_tar.c index 1ad9ac5..513909d 100644 --- a/busybox/archival/libunarchive/get_header_tar.c +++ b/busybox/archival/libunarchive/get_header_tar.c @@ -62,6 +62,7 @@ extern char get_header_tar(archive_handle_t *archive_handle) } tar; long sum = 0; long i; + static int end = 0; /* Align header */ data_align(archive_handle, 512); @@ -74,8 +75,17 @@ extern char get_header_tar(archive_handle_t *archive_handle) /* If there is no filename its an empty header */ if (tar.formated.name[0] == 0) { + if (end) { + /* This is the second consecutive empty header! End of archive! + * Read until the end to empty the pipe from gz or bz2 + */ + while (bb_full_read(archive_handle->src_fd, tar.raw, 512) == 512); + return(EXIT_FAILURE); + } + end = 1; return(EXIT_SUCCESS); } + end = 0; /* Check header has valid magic, "ustar" is for the proper tar * 0's are for the old tar format |