summaryrefslogtreecommitdiff
path: root/archival
AgeCommit message (Collapse)Author
2023-06-15libbb: code shrink: introduce and use [_]exit_FAILURE()Denys Vlasenko
function old new delta exit_FAILURE - 7 +7 _exit_FAILURE - 7 +7 run 198 199 +1 restore_state_and_exit 114 115 +1 xbsd_write_bootstrap 399 397 -2 vfork_compressor 209 207 -2 sig_handler 12 10 -2 serial_ctl 154 152 -2 parse_args 1169 1167 -2 onintr 21 19 -2 make_new_session 493 491 -2 login_main 988 986 -2 gotsig 35 33 -2 do_iplink 1315 1313 -2 addgroup_main 397 395 -2 inetd_main 1911 1908 -3 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 2/12 up/down: 16/-25) Total: -9 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-09cpio: tweak --helpDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-06libbb: consolidate NOMMU fix of restoring high bit in argv[0][0]Denys Vlasenko
function old new delta fork_or_rexec 46 56 +10 bootchartd_main 1087 1079 -8 cpio_main 674 661 -13 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 10/-21) Total: -11 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-02-23unzip: document some options we might supportDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-02-22unzip: clear SUID/GID bits, implement -K to not clear themDenys Vlasenko
function old new delta unzip_main 2656 2715 +59 packed_usage 34517 34552 +35 .rodata 105250 105251 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 95/0) Total: 95 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-11-29unzip -l: add missed big-endian conversions date and timePeter Kaestle
When calling unzip -l the date and time output was missing big-endian conversions. Signed-off-by: Peter Kaestle <peter.kaestle@nokia.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-08-30*: style fixDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-01-18libbb: shrink lineedit_read_key()Denys Vlasenko
function old new delta lineedit_read_key 237 231 -6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-01-17fix "defined but not used" warningsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-12-12libarchive/get_header_ar.c: fix extraction of archives from binutils in ↵Peter Korsgaard
deterministic mode GNU binutils in deterministic mode (ar rD or built with --enable-deterministic-archives) hard codes file mode to 0644 (NOT 0100644) since https://github.com/bminor/binutils-gdb/commit/36e4dce69dd2 This confuses busybox ar x (data_extract_all): touch a; ar rD a.ar a ar: creating a.ar busybox ar x a.ar ar: unrecognized file type hexdump -C a.ar 00000000 21 3c 61 72 63 68 3e 0a 61 2f 20 20 20 20 20 20 |!<arch>.a/ | 00000010 20 20 20 20 20 20 20 20 30 20 20 20 20 20 20 20 | 0 | 00000020 20 20 20 20 30 20 20 20 20 20 30 20 20 20 20 20 | 0 0 | 00000030 36 34 34 20 20 20 20 20 30 20 20 20 20 20 20 20 |644 0 | 00000040 20 20 60 0a | `.| As a workaround, force the mode bits to S_IFREG, as nothing else makes sense for ar. function old new delta get_header_ar 539 542 +3 Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-10-13cpio: add support for --renumber-inodes like GNU cpioAriadne Conill
The --renumber-inodes option renumbers the inodes starting from 1, so that the sequence of inodes is always stable. This helps with reproducibility. function old new delta cpio_o 961 1045 +84 .rodata 78422 78440 +18 bbconfig_config_bz2 6168 6164 -4 packed_usage 25764 25756 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 102/-12) Total: 90 bytes Signed-off-by: Ariadne Conill <ariadne@dereferenced.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-10-13cpio: add support for --ignore-devno like GNU cpioAriadne Conill
The --ignore-devno option is used to set device numbers to (0, 0). This can be useful in verifying whether a CPIO archive is reproducible. function old new delta cpio_o 922 961 +39 .rodata 78407 78422 +15 bbconfig_config_bz2 6161 6167 +6 packed_usage 25770 25764 -6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 60/-6) Total: 54 bytes Signed-off-by: Ariadne Conill <ariadne@dereferenced.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-10-11tar: prevent malicious archives with enormous long name sizes OOMing the machineDenys Vlasenko
function old new delta get_header_tar 1707 1752 +45 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-10-10*: add more beneficial NOINLINEsDenys Vlasenko
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>
2021-10-08tar: improve comments, add FIXMEs. no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-09-17libbb: eliminate a static data array in bb_mode_string()Denys Vlasenko
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>
2021-08-29bzip: make ftab[] and crc32table[] member arrays of EState, do not allocateDenys Vlasenko
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>
2021-08-22tar,smemcap: silence compiler warningRon Yorston
gcc 11.2.1 complains that the tar header checksum might overflow the checksum field. It won't and using an unsigned int for the calculation seems to convince the compiler too. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-08-22Regularize "NUL terminated input" --help textsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-08-20tar,smemcap: commonalyze checksumming code for tar headerDenys Vlasenko
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>
2021-08-02tar: exclude files before updating hardlink info listHarald van Dijk
When excluding one file, and including another file that is a hardlink of the excluded file, it should be stored as an ordinary file. function old new delta writeFileToTarball 489 493 +4 Signed-off-by: Harald van Dijk <harald@gigawatt.nl> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-08-02tar: simplify addition of --exclude=GLOB to the expansion of -X EXCLFILEDenys Vlasenko
function old new delta tar_main 1115 1105 -10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-23cpio: fix sscanf on unterminated bufferS Harris
Signed-off-by: S Harris <S.E.Harris@kent.ac.uk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-15unlzma: fix a case where we could read before beginning of bufferDenys Vlasenko
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>
2021-06-15*: more --help tweaksDenys Vlasenko
function old new delta packed_usage 33552 33541 -11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-14*: --help tweaksDenys Vlasenko
function old new delta packed_usage 33589 33552 -37 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-13*: more --help tweaks, mostly expanding ts --helpDenys Vlasenko
function old new delta packed_usage 33554 33596 +42 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-13*: --help tweaksDenys Vlasenko
function old new delta .rodata 103190 103189 -1 packed_usage 33590 33566 -24 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-25) Total: -25 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-03cpio: fix "cpio -d -p A/B/C"Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-05-03decompress_gunzip: simplify ERR_RET bit clearingDenys Vlasenko
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>
2021-04-14unzip: add -tDenys Vlasenko
function old new delta packed_usage 33584 33598 +14 .rodata 103218 103219 +1 unzip_main 2665 2656 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 15/-9) Total: 6 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-14unzip: fix for .zip archives with >4GB fileDenys Vlasenko
function old new delta unzip_main 2644 2665 +21 input_tab 926 927 +1 bb_banner 46 47 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 23/0) Total: 23 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-03-12decompress_gunzip: Fix DoS if gzip is corruptSamuel Sapalski
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>
2021-01-01tar: add TODO about a bug with non-writable directories on extractDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-18help text tweaksDenys Vlasenko
function old new delta packed_usage 33570 33502 -68 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-14libbb: add and use infrastructure for fixed page size optimizationDenys Vlasenko
function old new delta procps_scan 1121 1118 -3 getpagesize 6 - -6 rpm_main 1037 1027 -10 rpm2cpio_main 120 110 -10 ptok 38 21 -17 time_main 1282 1261 -21 mkswap_main 317 278 -39 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 0/6 up/down: 0/-106) Total: -106 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-14libbb: create and use mmap() helpersDenys Vlasenko
function old new delta mmap_anon - 22 +22 mmap_read - 21 +21 xmmap_anon - 16 +16 rpm_gettags 465 447 -18 bb_full_fd_action 498 480 -18 uevent_main 337 310 -27 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 0/3 up/down: 59/-63) Total: -4 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-13help text tweaksDenys Vlasenko
function old new delta packed_usage 33547 33545 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-12-08tar: expand --helpDenys Vlasenko
function old new delta packed_usage 33486 33590 +104 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-11-30decrease padding: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nillyDenys Vlasenko
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>
2020-11-30decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nillyDenys Vlasenko
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>
2020-11-16archival: avoid std namespace for local includesJoachim Nilsson
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>
2020-10-02tar: fix fallout of last_char_is(NULL) no longer being allowedDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-10-01libbb: shrink recursive_action() by reducing memory pressureDenys Vlasenko
function old new delta recursive_action1 - 316 +316 file_action_grep 161 164 +3 add_to_prg_cache_if_socket 202 205 +3 depmod_main 509 511 +2 writeFileToTarball 488 489 +1 parse_module 281 282 +1 fileAction 207 208 +1 act 189 190 +1 add_to_dirlist 65 64 -1 writeTarFile 196 194 -2 uuidcache_init 47 45 -2 uuidcache_check_device 109 107 -2 true_action 8 6 -2 run_parts_main 310 308 -2 netstat_main 534 532 -2 lsusb_main 29 27 -2 lspci_main 45 43 -2 initial_scan 138 136 -2 grep_main 845 843 -2 find_main 482 480 -2 config_file_action 437 435 -2 chmod_main 142 140 -2 dirAction 14 10 -4 diff_main 1544 1540 -4 chown_main 154 148 -6 skip_dir 136 129 -7 dir_act 191 184 -7 recursive_action 453 69 -384 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 7/20 up/down: 328/-439) Total: -111 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-10-01gcc-9.x warning fixesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-29dpkg: prevent important directories from being removedNorbert Lange
busybox will remove directory symlinks, which is at odds with common layouts that have some of bin/lib/lib32/lib64 symlinked. this adds a exludelist for critcal and often symlinked directories. Fixes: Bug 12551 function old new delta remove_file_array 139 231 +92 Signed-off-by: Norbert Lange <nolange79@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-25gzip -d with zcat enabled but gunzip disabled was misbehavingDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-24randomconfig fixesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-04-29unzip: -d should create the dirLauri Kasanen
The official Info-Zip unzip creates the dir if it doesn't exist. Signed-off-by: Lauri Kasanen <cand@gmx.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-11-08unxz: show -t in --helpDenys Vlasenko
function old new delta packed_usage 33236 33247 +11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>