Page MenuHomeFreeBSD

unzip: sync with NetBSD upstream to add passphrase support
Needs ReviewPublic

Authored by nyan on Tue, Feb 23, 1:58 PM.

Details

Reviewers
ak
yuripv
cem
mm
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
R10 FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

nyan requested review of this revision.Tue, Feb 23, 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
911

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
911

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.