Page MenuHomeFreeBSD

unzip: sync with NetBSD upstream to add passphrase support
ClosedPublic

Authored by nyan on Feb 23 2021, 1:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 8:38 AM
Unknown Object (File)
Wed, Nov 13, 8:20 AM
Unknown Object (File)
Tue, Nov 12, 10:00 AM
Unknown Object (File)
Tue, Nov 12, 4:31 AM
Unknown Object (File)
Tue, Nov 12, 12:15 AM
Unknown Object (File)
Sun, Nov 10, 10:46 PM
Unknown Object (File)
Sun, Nov 10, 2:15 AM
Unknown Object (File)
Sat, Nov 9, 5:02 PM
Subscribers

Details

Summary
  • Add support for password protected zip archives. We use memset_s() rather than explicit_bzero() for more portable (See PR).
  • Use success/failure macro in exit()
  • Mention ZIPX format in unzip(1)

Submitted by: Mingye Wang and Alex Kozlov (ak@)
PR: 244181
Obtained from: NetBSD

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

nyan requested review of this revision.Feb 23 2021, 1:58 PM
nyan created this revision.

Also, I just noticed that in half of return statements we don't use parentheses, which is violation of style(7).

usr.bin/unzip/unzip.c
912

We use global passphrase_buf pointer, so we can set *_client_data here to NULL: archive_read_set_passphrase_callback(a, NULL, &passphrase_callback);

nyan marked an inline comment as done.
nyan edited the summary of this revision. (Show Details)
In D28892#646718, @ak wrote:

Also, I just noticed that in half of return statements we don't use parentheses, which is violation of style(7).

Yes, but it's a difference of style between FreeBSD and NetBSD.
So I don't change it.

usr.bin/unzip/unzip.c
912

Thank you. I'll fix.

In D28892#647126, @nyan wrote:
In D28892#646718, @ak wrote:

Also, I just noticed that in half of return statements we don't use parentheses, which is violation of style(7).

Yes, but it's a difference of style between FreeBSD and NetBSD.
So I don't change it.

Are we importing the whole file or just changes? If it is just changes, then our style(7) should take precedence. If the whole file is imported and kept "in sync" with NetBSD, we should consider moving it to contrib/

In D28892#647134, @mm wrote:
In D28892#647126, @nyan wrote:
In D28892#646718, @ak wrote:

Also, I just noticed that in half of return statements we don't use parentheses, which is violation of style(7).

Yes, but it's a difference of style between FreeBSD and NetBSD.
So I don't change it.

Are we importing the whole file or just changes? If it is just changes, then our style(7) should take precedence. If the whole file is imported and kept "in sync" with NetBSD, we should consider moving it to contrib/

Ok, I'll fix for FreeBSD style as individual commits to separate from this (sync with NetBSD) topic.
Thank you for suggestions.

mizhka added a subscriber: mizhka.

I've found that I have reimplemented this patch by myself (due to lack of internet access):
https://reviews.freebsd.org/D30609

Let's ship it

This revision is now accepted and ready to land.Jun 2 2021, 10:30 AM