SHA: Add a runtime sanity check that sha commands output something that appears to be a real sha.

This after fielding a bug where git-annex was built with a sha256 program
whose output checked out, but was then run with one that output lines
like:

SHA256 (file) = <sha here>

Which it then parsed as having a SHA256 of "SHA256"!

Now the output of the command is required to be of the right length,
and contain only the right characters.
This commit is contained in:
Joey Hess 2013-05-07 20:19:37 -04:00
parent 53f1d36b35
commit cda0ed5d25
2 changed files with 24 additions and 2 deletions

2
debian/changelog vendored
View file

@ -15,6 +15,8 @@ git-annex (4.20130502) UNRELEASED; urgency=low
* git-annex-shell: Ensure that received files can be read. Files
transferred from some Android devices may have very broken permissions
as received.
* SHA: Add a runtime sanity check that sha commands output something
that appears to be a real sha.
-- Joey Hess <joeyh@debian.org> Thu, 02 May 2013 20:39:19 -0400