aboutsummaryrefslogtreecommitdiff
path: root/archival/unzip.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'busybox' into mergeRon Yorston2018-03-011-11/+14
|\
| * tar,unzip: postpone creation of symlinks with "suspicious" targetsDenys Vlasenko2018-02-201-11/+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-1/+3
|\|
| * unzip: do not set directory mode to 0777Denys Vlasenko2018-02-061-1/+3
| | | | | | | | | | | | https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=882177 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-12-091-8/+9
|\|
| * unzip: add missing -j to trivial usageEugene Rudoy2017-11-091-1/+1
| | | | | | | | | | Signed-off-by: Eugene Rudoy <gene.devel@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unzip: fix content listing and filtering when -j is usedEugene Rudoy2017-11-091-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original Info-ZIP's unzip uses unstripped filenames while doing content listing and filtering, i.e. - in content listing mode -j is ignored completely - filtering is applied to non-stripped names, -j takes effect first while extracting the files 997ad2c64abbe931dffa3598b015c5de04e515cf strips path components a little bit too early resulting in behavior deviations. Fix it by doing stripping after listing/filtering. p.s. Info-ZIP's unzip behavior is the same as that of tar in --strip-components=NUM mode Signed-off-by: Eugene Rudoy <gene.devel@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-08-221-2/+8
|\|
| * libarchive: do not extract unsafe symlinks unless $EXTRACT_UNSAFE_SYMLINKS=1Denys Vlasenko2017-08-101-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | unzip: omit special treatment of non-GNU getoptRon Yorston2017-07-301-1/+1
| | | | | | | | | | | | MinGW's getopt is sufficiently similar to GNU's getopt that the code to handle '-x' in the option string isn't required. This doesn't change the behaviour, which was already correct, but saves a few bytes.
* | Merge branch 'busybox' into mergeRon Yorston2017-07-291-0/+1
|\|
| * unzip: fix regression on big-endian machinesNatanael Copa2017-07-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | This fixes a regression which was introduced with commit 2a0867a5 ("unzip: optional support for bzip2 and lzma") and causes unzip to exit with error when extracting archives: unzip: unsupported method 2048 Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-07-241-64/+141
|\|
| * config: deindent all help textsDenys Vlasenko2017-07-211-8/+8
| | | | | | | | | | | | Those two spaces after tab have no effect, and always a nuisance when editing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unzip: sanitize filename length: malloc(1234mb) is not funnyDenys Vlasenko2017-07-201-2/+8
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unzip: implement -j, closes 9126Denys Vlasenko2017-07-201-16/+30
| | | | | | | | | | | | | | | | | | | | function old new delta unzip_main 2642 2703 +61 packed_usage 31747 31770 +23 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 84/0) Total: 84 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unzip: robustify overwrite checksDenys Vlasenko2017-07-201-31/+53
| | | | | | | | | | | | | | | | | | | | function old new delta get_lstat_mode - 55 +55 unzip_main 2667 2642 -25 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/1 up/down: 55/-25) Total: 30 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unzip: support symlinks. Closes 10031Denys Vlasenko2017-07-201-13/+48
| | | | | | | | | | | | | | function old new delta unzip_main 2519 2667 +148 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Update menuconfig items with approximate applet sizesDenys Vlasenko2017-07-181-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-07-181-0/+21
|\|
| * unzip: TODO for symlink supportDenys Vlasenko2017-07-111-0/+21
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-05-291-1/+1
|\|
| * whitespace fixDenys Vlasenko2017-03-241-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-02-081-219/+270
|\|
| * unzip: match "Defl:?" display with info-zip; cosmetic code shufflingDenys Vlasenko2017-01-091-102/+109
| | | | | | | | | | | | | | | | | | Large nested indented code blocks made more sane with a few gotos. function old new delta unzip_main 2491 2519 +28 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unzip: optional support for xzDenys Vlasenko2017-01-091-0/+13
| | | | | | | | | | | | | | function old new delta unzip_main 2476 2491 +15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unzip: optional support for bzip2 and lzmaDenys Vlasenko2017-01-091-35/+58
| | | | | | | | | | | | | | | | function old new delta unzip_main 2376 2476 +100 bbunpack 750 745 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unzip: do not use CDF.extra_len, read local file header. Closes 9536Denys Vlasenko2017-01-081-114/+122
| | | | | | | | | | | | | | | | | | While at it, shorten many field and variable names. function old new delta unzip_main 2334 2376 +42 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | unzip: use data from local header rather than CDFRon Yorston2017-01-081-1/+1
| | | | | | | | | | | | | | | | The zip file referenced in this bug report: https://bugs.busybox.net/show_bug.cgi?id=9536 isn't extracted correctly with the upstream fix.
* | Merge branch 'busybox' into mergeRon Yorston2017-01-081-123/+163
|\|
| * unzip: remove now-pointless lseek which returns current positionCristian Ionescu-Idbohrn2017-01-051-5/+0
| | | | | | | | | | | | | | | | | | | | | | archival/unzip.c: In function 'read_next_cdf': archival/unzip.c:271:8: warning: variable 'org' set but not used [-Wunused-but-set-variable] off_t org; ^~~ Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * typo fix in config help textDenys Vlasenko2017-01-051-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unzip: properly use CDF to find compressed files. Closes 9536Denys Vlasenko2017-01-051-120/+165
| | | | | | | | | | | | | | function old new delta unzip_main 2437 2350 -87 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2016-05-161-42/+96
|\|
| * *: slap on a few ALIGN1/2s where appropriateDenys Vlasenko2016-04-221-1/+1
| | | | | | | | | | | | | | | | | | | | The result of looking at "grep -F -B2 '*fill*' busybox_unstripped.map" text data bss dec hex filename 829901 4086 1904 835891 cc133 busybox_before 829665 4086 1904 835655 cc047 busybox Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unzip: shorter code for date/time generationDenys Vlasenko2016-04-181-6/+6
| | | | | | | | | | | | | | function old new delta unzip_main 2426 2414 -12 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unzip: better match for "standard" unzip's output; string shrinkageDenys Vlasenko2016-04-181-29/+33
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta unzip_main 2490 2426 -64 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-64) Total: -64 bytes text data bss dec hex filename 924008 906 17160 942074 e5ffa busybox_old 923846 906 17160 941912 e5f58 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unzip: fix percent overflow; show "stored" files properlyDenys Vlasenko2016-04-181-6/+29
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unzip: fix a case where we find wrong CDE. Closes 8821Denys Vlasenko2016-04-171-8/+35
| | | | | | | | | | | | | | function old new delta unzip_main 2472 2490 +18 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2015-07-141-2/+0
|\|
| * Removes stray empty line from codeManinder Singh2015-07-131-2/+0
| | | | | | | | | | | | | | | | | | This patch removes stray empty line from busybox code reported by script find_stray_empty_lines Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Akhilesh Kumar <akhilesh.k@samsung.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2015-03-141-11/+24
|\| | | | | | | | | | | Conflicts: coreutils/od_bloaty.c libbb/lineedit.c
| * unzip: prevent attacks via malicious filenamesDenys Vlasenko2015-02-101-11/+24
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Use MinGW-w64 by defaultRon Yorston2015-01-071-1/+1
| |
* | Changes to allow building with MinGW-w64Ron Yorston2015-01-051-0/+3
|/
* libarchive: add capability to unpack to mem.bufferDenys Vlasenko2014-12-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-6/+6
| | | | | | No code changes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* archival/*: move "config:" snippets into .c filesDenys Vlasenko2013-11-141-0/+10
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* archival/*: move "applet:" snippets into .c files, part 2Denys Vlasenko2013-11-141-0/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* archival/*: move "kbuild:" snippets into .c filesDenys Vlasenko2013-11-141-4/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>