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)
Feb 10 2024, 5:55 PM
Unknown Object (File)
Feb 2 2024, 8:58 AM
Unknown Object (File)
Nov 22 2023, 1:08 AM
Unknown Object (File)
Nov 8 2023, 5:07 AM
Unknown Object (File)
Nov 6 2023, 4:28 PM
Unknown Object (File)
Nov 6 2023, 3:36 PM
Unknown Object (File)
Nov 3 2023, 6:03 AM
Unknown Object (File)
Oct 9 2023, 8:13 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 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