Page MenuHomeFreeBSD

portsnap: consistently add .gz extension on gunzip invocation
AbandonedPublic

Authored by emaste on Aug 26 2016, 12:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 4, 10:24 PM
Unknown Object (File)
Mon, Nov 3, 1:39 AM
Unknown Object (File)
Tue, Oct 21, 2:44 AM
Unknown Object (File)
Oct 6 2025, 4:58 PM
Unknown Object (File)
Oct 3 2025, 9:29 PM
Unknown Object (File)
Jul 6 2025, 9:30 PM
Unknown Object (File)
Jul 3 2025, 1:55 AM
Unknown Object (File)
Jun 30 2025, 9:06 PM
Subscribers
None

Details

Summary

gunzip attempts to open the file name as given, and if that does not exist attempts to open the file name with a .gz extension appended. Prior to this change, in all but one case portsnap appended the .gz extension when invoking gunzip, but did not in fetch_snapshot_verify. Thus it was possible that if two files ${F} and ${F}.gz both existed, ${F} will be used by fetch_snapshot_verify and ${F}.gz everywhere else. By appending the extension consistently we ensure that all cases process the same file.

Issue reported in the "non-cryptanalytic attacks against freebsd update components" anonymous gist.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste retitled this revision from to portsnap: consistently add .gz extension on gunzip invocation.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
delphij edited edge metadata.
delphij added inline comments.
usr.sbin/portsnap/portsnap/portsnap.sh
654

We already have a similar change staged already, but slightly differently. (gunzip -c < snap/${F}.gz). This approach is better because it does not rely on gunzip's capability of detecting files.

This revision now requires changes to proceed.Aug 26 2016, 12:26 AM