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
F137907471: D7650.id19703.diff
Thu, Nov 27, 2:40 AM
Unknown Object (File)
Thu, Nov 20, 11:35 PM
Unknown Object (File)
Thu, Nov 20, 11:34 PM
Unknown Object (File)
Thu, Nov 20, 11:31 PM
Unknown Object (File)
Fri, Nov 14, 10:25 PM
Unknown Object (File)
Tue, Nov 4, 10:24 PM
Unknown Object (File)
Mon, Nov 3, 1:39 AM
Unknown Object (File)
Oct 21 2025, 2:44 AM
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