Bug 244181 - unzip: Add passphrase and GLIBC build support
Summary: unzip: Add passphrase and GLIBC build support
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs mailing list
URL:
Keywords: needs-qa, patch
Depends on:
Blocks:
 
Reported: 2020-02-17 03:37 UTC by Mingye Wang
Modified: 2020-03-24 09:30 UTC (History)
2 users (show)

See Also:
koobs: maintainer-feedback? (des)
koobs: maintainer-feedback? (ak)
koobs: mfc-stable12?
koobs: mfc-stable11?


Attachments
Support glibc builds (916 bytes, patch)
2020-02-17 03:37 UTC, Mingye Wang
no flags Details | Diff
Add passphrase support (2.95 KB, patch)
2020-02-17 03:38 UTC, Mingye Wang
no flags Details | Diff
Mention ZIPX in unzip(1) (702 bytes, patch)
2020-02-17 03:38 UTC, Mingye Wang
no flags Details | Diff
Add passphrase support (v2) (3.26 KB, patch)
2020-02-18 09:26 UTC, Mingye Wang
no flags Details | Diff
Add passphrase support (v3) (3.39 KB, patch)
2020-02-19 03:50 UTC, Mingye Wang
no flags Details | Diff
Add passphrase support (2.97 KB, patch)
2020-03-24 09:30 UTC, Alex Kozlov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mingye Wang 2020-02-17 03:37:56 UTC
Created attachment 211703 [details]
Support glibc builds

I would like to add the attached series of patches to unzip:

1. glibc support, since some people on libarchive's GitHub page is showing interest in this replacement util.
2. passsphrase support, both in the unsafe command-line entry form (-P) and in the safe getpassphrase(3) form.
3. minor edit to the manpage, just to remind people that we can decompress fancy ZIPX archives if libarchive can.

I thought about adding the filename iconv stuff from info-zip's unzip beta 6.10b, but doing stuff like iconv_open is a bit too much for me now. It *is* a nice feature though, at least according to the Linux users who came up with unzip-iconv in the first place. I might just add it sometime.

The patch is based against FreeBSD GitHub src tree. The last commit in usr.bin/unzip should be 7551d83.
Comment 1 Mingye Wang 2020-02-17 03:38:21 UTC
Created attachment 211704 [details]
Add passphrase support
Comment 2 Mingye Wang 2020-02-17 03:38:46 UTC
Created attachment 211705 [details]
Mention ZIPX in unzip(1)
Comment 3 Alex Kozlov freebsd_committer 2020-02-17 14:10:27 UTC
The 'support glibc' and 'mention zipx' patches looks alright, but I think you forgot to free passphrase_buf in 'add passphrase' patch.
Comment 4 Mingye Wang 2020-02-18 09:26:00 UTC
Created attachment 211738 [details]
Add passphrase support (v2)

Oops! Here is the patch with the free() added.
Comment 5 Mingye Wang 2020-02-18 10:38:21 UTC
Expect a passphrase v3 -- it simply doesn't make sense to free in main() when the only cause of malloc() is planted by unzip().
Comment 6 Yuri Pankov freebsd_committer 2020-02-18 11:14:03 UTC
You might want to open this at https://reviews.freebsd.org so it's easier to comment on the code.
Comment 7 Mingye Wang 2020-02-19 03:50:13 UTC
Created attachment 211753 [details]
Add passphrase support (v3)
Comment 8 Alex Kozlov freebsd_committer 2020-03-24 09:30:50 UTC
Created attachment 212674 [details]
Add passphrase support

It seems that unzip fails to build with the last passphrase support patch. I fixed it a little, please check it out.