Page MenuHomePhabricator

Provide "bin/files integrity" for debugging, maintaining and backfilling integrity hashes
ClosedPublic

Authored by epriestley on Apr 6 2017, 2:01 PM.
Tags
None
Referenced Files
F14122814: D17629.diff
Fri, Nov 29, 7:08 PM
Unknown Object (File)
Wed, Nov 27, 10:09 PM
Unknown Object (File)
Tue, Nov 26, 12:45 PM
Unknown Object (File)
Sun, Nov 3, 8:46 AM
Unknown Object (File)
Sun, Nov 3, 8:46 AM
Unknown Object (File)
Sun, Nov 3, 8:46 AM
Unknown Object (File)
Sat, Nov 2, 1:59 AM
Unknown Object (File)
Oct 24 2024, 12:26 AM
Subscribers
None

Details

Summary

Ref T12470. Provides an "integrity" utility which runs in these modes:

  • Verify: check that hashes match.
  • Compute: backfill missing hashes.
  • Strip: remove hashes. Useful for upgrading across a hash change.
  • Corrupt: intentionally corrupt hashes. Useful for debugging.
  • Overwrite: force hash recomputation.

Users normally shouldn't need to run any of this stuff, but this provides a reasonable toolkit for managing integrity hashes.

I'll recommend existing installs use bin/files integrity --compute all in the upgrade guidance to backfill hashes for existing files.

Test Plan
  • Ran the script in many modes against various files, saw expected operation, including:
  • Verified a file, corrupted it, saw it fail.
  • Verified a file, stripped it, saw it have no hash.
  • Stripped a file, computed it, got a clean verify.
  • Stripped a file, overwrote it, got a clean verify.
  • Corrupted a file, overwrote it, got a clean verify.
  • Overwrote a file, overwrote again, got a no-op.

Diff Detail

Repository
rP Phabricator
Branch
files20
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 16329
Build 21711: Run Core Tests
Build 21710: arc lint + arc unit