diff options
author | KatolaZ <katolaz@freaknet.org> | 2017-07-23 10:07:33 +0200 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2017-07-23 10:07:33 +0200 |
commit | e6af4d1a5ce976fb74c70760675f7f31767f734d (patch) | |
tree | 52ed58a0c57213660034906b83ab6b38ef0b5488 | |
parent | b3e10f839ce07bd9351f5c5af88ffb4794d94896 (diff) |
hash check is working
-rw-r--r-- | exec.go | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -41,8 +41,10 @@ func check_hash(file, hash string) error { return err } hash_bytes := sha256.Sum256(data) - computed_hash := string(hash_bytes[:sha256.Size]) - if string(computed_hash) == hash { + computed_hash := fmt.Sprintf("%x", string(hash_bytes[:sha256.Size])) + debug.log("[check_hash] configured hash string: %s\n", hash) + debug.log("[check_hash] computed hash string: %s\n", computed_hash) + if computed_hash == hash { return nil } else { return fmt.Errorf("WARNING!!! HASH MISMATCH FOR %s", file) @@ -74,6 +76,7 @@ func exec_tag(tag *SCORSHtag_cfg, args []string, env []string) []error { // if the hash does not match, abort the command if err != nil { log.Printf("[tag: %s] %s -- aborting command\n", tag.Name, err) + ret = append(ret, err) continue } else { // finally, the command can be executed |