aboutsummaryrefslogtreecommitdiff
path: root/archival/libarchive (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'busybox' into mergeRon Yorston2021-10-133-5/+11
|\
| * tar: prevent malicious archives with enormous long name sizes OOMing the machineDenys Vlasenko2021-10-111-3/+8
| | | | | | | | | | | | | | function old new delta get_header_tar 1707 1752 +45 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * *: add more beneficial NOINLINEsDenys Vlasenko2021-10-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta dec_main - 1729 +1729 -41 bytes fallbackQSort3 - 671 +671 -70 bytes verify_sun - 481 +481 -107 bytes verify 1330 742 -588 fallbackSort 1469 728 -741 unpack_xz_stream 2306 536 -1770 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 0/3 up/down: 2881/-3099) Total: -218 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tar: improve comments, add FIXMEs. no code changesDenys Vlasenko2021-10-081-2/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-09-211-2/+3
|\|
| * libbb: eliminate a static data array in bb_mode_string()Denys Vlasenko2021-09-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta print_stat 861 869 +8 header_verbose_list_ar 73 77 +4 display_single 975 979 +4 header_verbose_list 237 239 +2 bb_mode_string 124 115 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/1 up/down: 18/-9) Total: 9 bytes text data bss dec hex filename 1043136 559 5052 1048747 1000ab busybox_old 1043153 559 5020 1048732 10009c busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-08-302-8/+10
|\|
| * bzip: make ftab[] and crc32table[] member arrays of EState, do not allocateDenys Vlasenko2021-08-292-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta mainSort 941 986 +45 fallbackSort 1471 1469 -2 add_pair_to_block 194 188 -6 compressStream 543 515 -28 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/3 up/down: 45/-36) Total: 9 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-06-282-2/+6
|\|
| * cpio: fix sscanf on unterminated bufferS Harris2021-06-231-1/+2
| | | | | | | | | | Signed-off-by: S Harris <S.E.Harris@kent.ac.uk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unlzma: fix a case where we could read before beginning of bufferDenys Vlasenko2021-06-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Testcase: 21 01 01 00 00 00 00 00 e7 01 01 01 ef 00 df b6 00 17 02 10 11 0f ff 00 16 00 00 Unfortunately, the bug is not reliably causing a segfault, the behavior depends on what's in memory before the buffer. function old new delta unpack_lzma_stream 2762 2768 +6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-05-141-2/+9
|\|
| * decompress_gunzip: simplify ERR_RET bit clearingDenys Vlasenko2021-05-031-3/+2
| | | | | | | | | | | | My gcc is in fact clever enough to do it itself, but let's be explicit Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * decompress_gunzip: Fix DoS if gzip is corruptSamuel Sapalski2021-03-121-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On certain corrupt gzip files, huft_build will set the error bit on the result pointer. If afterwards abort_unzip is called huft_free might run into a segmentation fault or an invalid pointer to free(p). In order to mitigate this, we check in huft_free if the error bit is set and clear it before the linked list is freed. Signed-off-by: Samuel Sapalski <samuel.sapalski@nokia.com> Signed-off-by: Peter Kaestle <peter.kaestle@nokia.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: implement symlink(2)Ron Yorston2021-02-121-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide an implementation of symlink(2). Calls to symlink(2) will fail in default Windows installations unless running with elevated privileges. Failure to create a symlink when extracting files from an archive is therefore treated as a non-fatal error. There are two ways to permit the creation of symlinks: - Edit security policy to give users the 'Create symbolic links' privilege. Unfortunately this doesn't work for users who are an Administrator. - Enable developer mode, which is available in later versions of Windows 10. The ability to create symlinks is not available in Windows XP or ReactOS.
* | libarchive: allow extraction of hard linksRon Yorston2021-01-191-3/+7
| | | | | | | | | | | | | | | | 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 Yorston2021-01-146-6/+10
|\|
| * tar: add TODO about a bug with non-writable directories on extractDenys Vlasenko2021-01-011-0/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * decrease padding: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nillyDenys Vlasenko2020-11-301-2/+2
| | | | | | | | | | | | | | | | text data bss dec hex filename 1021236 559 5052 1026847 fab1f busybox_old 1021120 559 5052 1026731 faaab busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nillyDenys Vlasenko2020-11-302-2/+2
| | | | | | | | | | | | | | | | text data bss dec hex filename 1021988 559 5052 1027599 fae0f busybox_old 1021236 559 5052 1026847 fab1f busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * archival: avoid std namespace for local includesJoachim Nilsson2020-11-162-2/+2
| | | | | | | | | | | | | | | | Avoid using same include file naming pattern as available in GLIBC. Renamed to match grp_.h et al. Signed-off-by: Joachim Nilsson <troglobit@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2020-11-121-1/+1
|\|
| * tar: fix fallout of last_char_is(NULL) no longer being allowedDenys Vlasenko2020-10-021-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: move code to fork (de)compressor to a functionRon Yorston2020-08-051-15/+1
| | | | | | | | | | | | | | | | Use a new common function, mingw_fork_compressor(), to implement fork_transformer() in open_transformer.c and vfork_compressor() in tar.c. Saves 160 bytes.
* | Merge branch 'busybox' into mergeRon Yorston2020-01-083-54/+79
|\|
| * gunzip: fix incorrect decoding of "fixed" inflate blocksDenys Vlasenko2019-10-261-10/+20
| | | | | | | | | | | | | | | | | | | | function old new delta huft_build 1008 1022 +14 inflate_block 1253 1256 +3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 17/0) Total: 17 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * gunzip: code shrink by using int-, not short-sized struct memberDenys Vlasenko2019-10-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | function old new delta inflate_block 1254 1253 -1 inflate_codes 629 621 -8 huft_build 1054 1008 -46 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-55) Total: -55 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * gzip: code shrinkDenys Vlasenko2019-10-191-29/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | huft_build() still has way too many params function old new delta lit - 94 +94 dist - 94 +94 huft_build 1058 1054 -4 inflate_block 1281 1254 -27 cpdext 30 - -30 cplext 31 - -31 cpdist 60 - -60 cplens 62 - -62 ------------------------------------------------------------------------------ (add/remove: 2/4 grow/shrink: 0/2 up/down: 188/-214) Total: -26 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * gzip: code shrinkDenys Vlasenko2019-10-191-27/+26
| | | | | | | | | | | | | | | | | | | | | | | | huft_build() has way too many params function old new delta inflate_block 1293 1281 -12 huft_build 1085 1058 -27 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-39) Total: -39 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dpkg-deb: work around bogus error message when working with XZ compressed ↵Denys Vlasenko2019-10-112-2/+20
| | | | | | | | | | | | | | | | | | | | packages function old new delta unpack_xz_stream 2309 2317 +8 bb_full_fd_action 464 472 +8 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2019-08-1612-39/+39
|\|
| * libbb: reduce the overhead of single parameter bb_error_msg() callsJames Byrne2019-07-0212-39/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Back in 2007, commit 0c97c9d43707 ("'simple' error message functions by Loic Grenie") introduced bb_simple_perror_msg() to allow for a lower overhead call to bb_perror_msg() when only a string was being printed with no parameters. This saves space for some CPU architectures because it avoids the overhead of a call to a variadic function. However there has never been a simple version of bb_error_msg(), and since 2007 many new calls to bb_perror_msg() have been added that only take a single parameter and so could have been using bb_simple_perror_message(). This changeset introduces 'simple' versions of bb_info_msg(), bb_error_msg(), bb_error_msg_and_die(), bb_herror_msg() and bb_herror_msg_and_die(), and replaces all calls that only take a single parameter, or use something like ("%s", arg), with calls to the corresponding 'simple' version. Since it is likely that single parameter calls to the variadic functions may be accidentally reintroduced in the future a new debugging config option WARN_SIMPLE_MSG has been introduced. This uses some macro magic which will cause any such calls to generate a warning, but this is turned off by default to avoid use of the unpleasant macros in normal circumstances. This is a large changeset due to the number of calls that have been replaced. The only files that contain changes other than simple substitution of function calls are libbb.h, libbb/herror_msg.c, libbb/verror_msg.c and libbb/xfuncs_printf.c. In miscutils/devfsd.c, networking/udhcp/common.h and util-linux/mdev.c additonal macros have been added for logging so that single parameter and multiple parameter logging variants exist. The amount of space saved varies considerably by architecture, and was found to be as follows (for 'defconfig' using GCC 7.4): Arm: -92 bytes MIPS: -52 bytes PPC: -1836 bytes x86_64: -938 bytes Note that for the MIPS architecture only an exception had to be made disabling the 'simple' calls for 'udhcp' (in networking/udhcp/common.h) because it made these files larger on MIPS. Signed-off-by: James Byrne <james.byrne@origamienergy.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2019-05-272-18/+28
|\|
| * comment fixDenys Vlasenko2019-05-261-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libarchive: treat one "FIXME: avoid seek", take 2Denys Vlasenko2019-05-261-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libarchive: treat one "FIXME: avoid seek"Denys Vlasenko2019-05-241-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * bunzip2: the correct condition is "n < groupCount", not "n <= groupCount". ↵Denys Vlasenko2019-05-231-1/+1
| | | | | | | | | | | | | | | | | | Closes 11896 function old new delta get_next_block 1677 1681 +4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | libarchive: remove more symlink codeRon Yorston2019-02-141-3/+2
| | | | | | | | | | | | | | Since symlinks aren't supported in busybox-w32 remove more of the code that handles them. Saves 64 bytes.
* | Merge branch 'busybox' into mergeRon Yorston2019-01-101-1/+1
|\|
| * randomconfig fixesDenys Vlasenko2018-12-271-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | tar: return correct exit code for empty tar fileRon Yorston2019-01-061-5/+0
| | | | | | | | | | 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-285-15/+52
|\|
| * hush: allow hush to run embedded scriptsRon Yorston2018-11-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Embedded scripts require a shell to be present in the BusyBox binary. Allow either ash or hush to be used for this purpose. If both are enabled ash takes precedence. The size of the binary is unchanged in the default configuration: both ash and hush are present but support for embedded scripts isn't compiled into hush. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tar: skip 'V' headers (GNU volume label), closes 11526Denys Vlasenko2018-11-271-1/+2
| | | | | | | | | | | | | | function old new delta get_header_tar 1696 1690 -6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unlzma: fix too-eager corruption checkDenys Vlasenko2018-11-271-7/+13
| | | | | | | | | | | | | | function old new delta unpack_lzma_stream 2686 2674 -12 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tar: fix too eager autodetection, closes 11531Denys Vlasenko2018-11-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta is_suffixed_with - 54 +54 tar_main 1006 1026 +20 open_transformer 92 79 -13 config_file_action 478 458 -20 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/2 up/down: 74/-33) Total: 41 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * remove FAST_FUNC on a static functionDenys Vlasenko2018-11-021-2/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libarchive: add a function to unpack embedded dataRon Yorston2018-11-021-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ash: allow shell scripts to be embedded in the binaryDenys Vlasenko2018-11-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To assist in the deployment of shell scripts it may be convenient to embed them in the BusyBox binary. 'Embed scripts in the binary' takes any files in the directory 'embed', concatenates them with null separators, compresses them and embeds them in the binary. When scripts are embedded in the binary, scripts can be run as 'busybox SCRIPT [ARGS]' or by usual (sym)link mechanism. embed/nologin is provided as an example. function old new delta packed_scripts - 123 +123 unpack_scripts - 87 +87 ash_main 1103 1171 +68 run_applet_and_exit 78 128 +50 get_script_content - 32 +32 script_names - 10 +10 expmeta 663 659 -4 ------------------------------------------------------------------------------ (add/remove: 4/0 grow/shrink: 2/1 up/down: 370/-4) Total: 366 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox'Ron Yorston2018-07-254-21/+24
|\|