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)
Wed, Oct 23, 6:51 AM
Unknown Object (File)
Oct 5 2024, 8:21 PM
Unknown Object (File)
Oct 5 2024, 6:08 PM
Unknown Object (File)
Oct 4 2024, 9:17 AM
Unknown Object (File)
Oct 3 2024, 1:10 AM
Unknown Object (File)
Oct 2 2024, 9:41 PM
Unknown Object (File)
Oct 2 2024, 3:03 PM
Unknown Object (File)
Oct 1 2024, 9:17 AM
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 Skipped
Unit
Tests Skipped

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