aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2023-02-23 12:00:36 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2023-02-23 12:00:36 +0100
commit029740a3e43835d2a71696449baba5250a346e0a (patch)
treeca258beef1ec292b3eaa331eac892fd3d4e06518
parent75197998c22b0760a1a6d5e94f750b12855ef82f (diff)
downloadbusybox-w32-029740a3e43835d2a71696449baba5250a346e0a.tar.gz
busybox-w32-029740a3e43835d2a71696449baba5250a346e0a.tar.bz2
busybox-w32-029740a3e43835d2a71696449baba5250a346e0a.zip
unzip: document some options we might support
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--archival/unzip.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/archival/unzip.c b/archival/unzip.c
index 691a2d81b..71a302915 100644
--- a/archival/unzip.c
+++ b/archival/unzip.c
@@ -559,6 +559,11 @@ int unzip_main(int argc, char **argv)
559 * 204372 1 file 559 * 204372 1 file
560 */ 560 */
561 561
562//TODO: accept and ignore these?
563// -a convert to text files with 't' label, -aa: all files
564// -b do not convert to text - bbox: we don't convert anything
565// -D skip restoration of timestamps for extracted items - bbox: we don't restore these (yet?)
566// -X restore user:group ownership
562 opts = 0; 567 opts = 0;
563 /* '-' makes getopt return 1 for non-options */ 568 /* '-' makes getopt return 1 for non-options */
564 while ((i = getopt(argc, argv, "-d:lnotpqxjvK")) != -1) { 569 while ((i = getopt(argc, argv, "-d:lnotpqxjvK")) != -1) {
@@ -583,6 +588,7 @@ int unzip_main(int argc, char **argv)
583 xmove_fd(xopen("/dev/null", O_WRONLY), STDOUT_FILENO); 588 xmove_fd(xopen("/dev/null", O_WRONLY), STDOUT_FILENO);
584 /*fallthrough*/ 589 /*fallthrough*/
585 590
591// NB: -c extract files to stdout/screen (unlike -p, also prints .zip and file names to stdout)
586 case 'p': /* Extract files to stdout */ 592 case 'p': /* Extract files to stdout */
587 dst_fd = STDOUT_FILENO; 593 dst_fd = STDOUT_FILENO;
588 /*fallthrough*/ 594 /*fallthrough*/
@@ -853,6 +859,7 @@ int unzip_main(int argc, char **argv)
853 unzip_skip(zip.fmt.extra_len); 859 unzip_skip(zip.fmt.extra_len);
854 860
855 /* Guard against "/abspath", "/../" and similar attacks */ 861 /* Guard against "/abspath", "/../" and similar attacks */
862// NB: UnZip 6.00 has option -: to disable this
856 overlapping_strcpy(dst_fn, strip_unsafe_prefix(dst_fn)); 863 overlapping_strcpy(dst_fn, strip_unsafe_prefix(dst_fn));
857 864
858 /* Filter zip entries */ 865 /* Filter zip entries */