aboutsummaryrefslogtreecommitdiff
path: root/include/bb_archive.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge busybox into mergeRon Yorston2021-12-271-1/+0
|\ | | | | | | Fix merge conflict in coreutils/timeout.c.
| * libarchive: remove duplicate forward declarationBernhard Reutner-Fischer2021-11-281-1/+0
| | | | | | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-08-221-0/+1
|\|
| * tar,smemcap: commonalyze checksumming code for tar headerDenys Vlasenko2021-08-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | function old new delta chksum_and_xwrite_tar_header - 99 +99 writeheader 280 199 -81 chksum_and_xwrite 102 - -102 ------------------------------------------------------------------------------ (add/remove: 2/1 grow/shrink: 0/1 up/down: 99/-183) Total: -84 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | libarchive: allow extraction of hard linksRon Yorston2021-01-191-7/+0
| | | | | | | | | | | | | | | | Allow create_or_remember_link() to create hardlinks. As a result tar and cpio can now extract hard links. Since unzip only supports symlinks it sees no improvement. As before, attempts to extract symlinks result in a warning.
* | Merge branch 'busybox' into mergeRon Yorston2019-05-271-0/+6
|\|
| * libarchive: treat one "FIXME: avoid seek"Denys Vlasenko2019-05-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta xmalloc_read_with_initial_buf - 205 +205 setup_transformer_on_fd 154 150 -4 xmalloc_open_zipped_read_close 143 135 -8 xmalloc_read 201 10 -191 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/3 up/down: 205/-203) Total: 2 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | libarchive: remove more symlink codeRon Yorston2019-02-141-0/+3
| | | | | | | | | | | | | | Since symlinks aren't supported in busybox-w32 remove more of the code that handles them. Saves 64 bytes.
* | tar: return correct exit code for empty tar fileRon Yorston2019-01-061-0/+4
| | | | | | | | | | The WIN32 implementation of check_errors_in_children shouldn't have reset bb_got_signal as it's used to signal an error.
* | Merge branch 'busybox' into mergeRon Yorston2018-11-281-6/+1
|\|
| * libarchive: add a function to unpack embedded dataRon Yorston2018-11-021-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar code to unpack embedded data is used to decompress usage messages, embedded scripts and the config file (in the non-default bbconfig applet). Moving this code to a common function reduces the size of the default build and hides more of the internals of libarchive. function old new delta unpack_bz2_data - 135 +135 bb_show_usage 137 157 +20 get_script_content 32 47 +15 unpack_scripts 119 - -119 unpack_usage_messages 124 - -124 ------------------------------------------------------------------------------ (add/remove: 1/2 grow/shrink: 2/0 up/down: 170/-243) Total: -73 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox'Ron Yorston2018-07-251-8/+9
|\|
| * randomconfig fixesDenys Vlasenko2018-06-261-2/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tar: fix interaction of delayed symlink and hardlink creationHarald van Dijk2018-05-221-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta create_or_remember_link - 106 +106 create_links_from_list - 93 +93 find_applet_by_name 124 128 +4 unzip_main 2724 2726 +2 data_extract_all 891 873 -18 create_symlinks_from_list 64 - -64 create_or_remember_symlink 94 - -94 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 2/1 up/down: 205/-176) Total: 29 bytes Signed-off-by: Harald van Dijk <harald@gigawatt.nl> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2018-05-131-0/+4
|\|
| * ar: stop using static dataDenys Vlasenko2018-04-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | function old new delta static.ar_long_names 4 - -4 static.ar_long_name_size 4 - -4 get_header_ar 546 532 -14 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 0/1 up/down: 0/-22) Total: -22 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2018-04-091-1/+1
|\|
| * bzip2: fix two crashes on corrupted archivesDenys Vlasenko2018-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As it turns out, longjmp'ing into freed stack is not healthy... function old new delta unpack_usage_messages - 97 +97 unpack_bz2_stream 369 409 +40 get_next_block 1667 1677 +10 get_bits 156 155 -1 start_bunzip 212 183 -29 bb_show_usage 181 120 -61 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/3 up/down: 147/-91) Total: 56 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | libarchive: failure to extract symlink isn't fatalRon Yorston2018-04-091-0/+4
| | | | | | | | | | | | | | | | Recent upstream changes made the failure of symlink(2) when extracting from an archive a fatal error. The busybox-w32 implementation of symlink(2) always fails. Just issue a warning and move on.
* | Merge branch 'busybox' into mergeRon Yorston2018-03-011-9/+14
|\|
| * tar,unzip: postpone creation of symlinks with "suspicious" targetsDenys Vlasenko2018-02-201-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This mostly reverts commit bc9bbeb2b81001e8731cd2ae501c8fccc8d87cc7 "libarchive: do not extract unsafe symlinks unless $EXTRACT_UNSAFE_SYMLINKS=1" Users report that it is somewhat too restrictive. See https://bugs.busybox.net/show_bug.cgi?id=8411 In particular, this interferes with unpacking of busybox-based filesystems with links like "sbin/applet" -> "../bin/busybox". The change is made smaller by deleting ARCHIVE_EXTRACT_QUIET flag - it is unused since 2010, and removing conditionals on it allows commonalizing some error message codes. function old new delta create_or_remember_symlink - 94 +94 create_symlinks_from_list - 64 +64 tar_main 1002 1006 +4 unzip_main 2732 2724 -8 data_extract_all 984 891 -93 unsafe_symlink_target 147 - -147 ------------------------------------------------------------------------------ (add/remove: 2/1 grow/shrink: 1/2 up/down: 162/-248) Total: -86 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2018-02-131-0/+15
|\|
| * libarchive: move bbunpack constants to bb_archive.hDenys Vlasenko2018-02-011-0/+15
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-08-221-3/+1
|\|
| * libarchive: do not extract unsafe symlinks unless $EXTRACT_UNSAFE_SYMLINKS=1Denys Vlasenko2017-08-101-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta unsafe_symlink_target - 147 +147 unzip_main 2711 2732 +21 copy_file 1657 1678 +21 tar_main 999 971 -28 data_extract_all 1038 984 -54 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 2/2 up/down: 189/-82) Total: 107 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-07-291-0/+4
|\|
| * tar: postpone creation of symlinks with "suspicious" targets. Closes 8411Denys Vlasenko2017-07-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | function old new delta data_extract_all 968 1038 +70 tar_main 952 986 +34 scan_tree 258 262 +4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 108/0) Total: 108 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2016-07-071-4/+4
|\|
| * libarchive: fix xmalloc_open_zipped_read_close() on NOMMUDenys Vlasenko2016-06-201-4/+4
| | | | | | | | | | | | | | | | | | The somewhat new "unpack in memory" code was broken for xmalloc_open_zipped_read_close() on NOMMU: we seek back over signature, but then expect it to be already consumed. Stop seeking back in this case. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2015-10-311-0/+3
|\|
| * tar: add support for --strip-components=NDenys Vlasenko2015-10-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | function old new delta data_extract_all 882 995 +113 tar_longopts 290 309 +19 tar_main 938 942 +4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 136/0) Total: 136 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2015-10-191-0/+3
|\|
| * cpio: implement -R/--ownerAaro Koskinen2015-10-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement -R/--owner to force ownership of files. function old new delta cpio_main 532 586 +54 get_header_cpio 909 939 +30 print 36 65 +29 cpio_o 804 832 +28 cpio_TRAILER - 11 +11 packed_usage 30667 30662 -5 static.trailer 11 - -11 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 4/1 up/down: 152/-16) Total: 136 bytes Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Enable seamless compression for WIN32Ron Yorston2015-05-271-0/+10
|/ | | | | | | | | | | | | | | | In the archival code we pretend that WIN32 is a no-MMU platform and use the new mingw_popen_fd routine to pipe data to/from commands to compress/decompress. The pretence is maintained by redefining MMU macros in bb_archive.h. This is mostly used in the archival code but there are a handful of places where it's used to access public interfaces. The symbol BB_ARCHIVE_PUBLIC is defined in these places. With these changes: tar supports seamless compression/decompression rpm2cpio and dpkg-deb can be enabled
* dpkg: update supported compression methodsDenys Vlasenko2015-01-301-0/+1
| | | | | | | | | | | | | | Based on a patch by Ron Yorston <rmy@tigress.co.uk> function old new delta get_header_tar_xz - 60 +60 filter_accept_list_reassign 128 188 +60 unpack_package 585 621 +36 init_archive_deb_control 52 76 +24 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 3/0 up/down: 180/0) Total: 180 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libarchive: add capability to unpack to mem.bufferDenys Vlasenko2014-12-071-14/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The performance and number of processes for a "depmod -a" with gzipped modules was abysmal. This patch adds a code path without fork, benefiting all users of xmalloc_open_zipped_read_close. "modinfo radeon.ko.gz", a single-file reader, got 30% faster. "depmod -a", which used to fork over 800 times, got 20% faster. Heavily based on a patch by Lauri Kasanen <curaga@operamail.com> function old new delta setup_transformer_on_fd - 159 +159 transformer_write - 122 +122 fork_transformer - 112 +112 xmalloc_open_zipped_read_close 63 118 +55 read_bunzip 1866 1896 +30 xtransformer_write - 19 +19 unzip_main 2449 2462 +13 bbunpack 755 766 +11 unpack_lzma_stream 2717 2723 +6 unpack_xz_stream 2393 2397 +4 unpack_Z_stream 1173 1175 +2 inflate_unzip 111 105 -6 check_signature16 70 63 -7 unpack_bz2_stream 359 349 -10 unpack_unxz 12 - -12 unpack_unlzma 12 - -12 unpack_uncompress 12 - -12 unpack_gunzip 12 - -12 unpack_bunzip2 12 - -12 open_transformer 106 92 -14 inflate_unzip_internal 1945 1916 -29 unpack_gz_stream 693 655 -38 open_zipped 89 47 -42 setup_unzip_on_fd 142 53 -89 ------------------------------------------------------------------------------ (add/remove: 4/5 grow/shrink: 7/8 up/down: 533/-295) Total: 238 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Rename transformer_aux_data_t -> transformer_state_tDenys Vlasenko2014-12-071-12/+12
| | | | | | No code changes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* rpm: use "create+rename" method of replacing existing filesDenys Vlasenko2013-02-201-0/+3
| | | | | | | | Users were reporting getting errors like "ls: error while loading shared libraries: libc.so.6: ELF load command past end of file" while rpm was unpacking glibc tarball. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace fixes. no code changesDenys Vlasenko2013-01-151-3/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* dpkg: fix creation of .list files (were empty since b768aeb). Closes 5324Denys Vlasenko2012-06-221-0/+1
| | | | | | | | | | | | | While at it, fix filename order and free the list of names. function old new delta llist_rev - 21 +21 get_header_tar 1733 1741 +8 unpack_package 587 585 -2 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/1 up/down: 29/-2) Total: 27 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar,rpm2cpio: check that child decompressor did not error outDenys Vlasenko2012-03-061-0/+1
| | | | | | | | | | | | | function old new delta check_errors_in_children - 57 +57 tar_main 833 848 +15 get_header_tar 1720 1733 +13 rpm2cpio_main 147 140 -7 handle_SIGCHLD 41 - -41 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 2/1 up/down: 85/-48) Total: 37 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* update seamless uncompression codeDenys Vlasenko2012-03-061-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes "tar tf hello_world.txz" work without adding special-casing for ".txz" extension. It also removes ever-growing magic checking code in rpm2cpio and get_header_tar - we reuse one which lives in setup_unzip_on_fd. function old new delta unpack_gz_stream 7 566 +559 check_signature16 - 70 +70 setup_unzip_on_fd 99 142 +43 handle_SIGCHLD - 41 +41 unpack_bz2_stream 342 376 +34 unzip_main 2352 2385 +33 bbunpack 503 533 +30 open_transformer 74 102 +28 unpack_Z_stream 1278 1304 +26 unpack_gunzip 101 123 +22 init_transformer_aux_data - 18 +18 unpack_xz_stream 2388 2402 +14 open_zipped 131 141 +10 rpm_main 1358 1363 +5 get_header_tar_lzma 52 57 +5 get_header_tar_bz2 52 57 +5 unpack_lzma_stream 2698 2702 +4 hash_find 234 233 -1 get_header_tar 1759 1733 -26 get_header_tar_gz 92 57 -35 unpack_uncompress 51 12 -39 rpm2cpio_main 201 147 -54 unpack_unxz 67 12 -55 unpack_bz2_stream_prime 55 - -55 get_header_tar_Z 86 - -86 unpack_gz_stream_with_info 539 - -539 ------------------------------------------------------------------------------ (add/remove: 3/3 grow/shrink: 14/6 up/down: 947/-890) Total: 57 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: add support for PAX-encoded path=LONGFILENAMEDenys Vlasenko2012-02-231-4/+5
| | | | | | | function old new delta get_header_tar 1478 1759 +281 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* suppress a "integer overflow in expression" waring on big endian. Closes 4405Denys Vlasenko2011-12-051-2/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* rename archive.h to bb_archive.h. no code changesDenys Vlasenko2011-09-221-0/+241
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>