summaryrefslogtreecommitdiff
path: root/exec.go
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2017-07-23 10:07:33 +0200
committerKatolaZ <katolaz@freaknet.org>2017-07-23 10:07:33 +0200
commite6af4d1a5ce976fb74c70760675f7f31767f734d (patch)
tree52ed58a0c57213660034906b83ab6b38ef0b5488 /exec.go
parentb3e10f839ce07bd9351f5c5af88ffb4794d94896 (diff)
hash check is working
Diffstat (limited to 'exec.go')
-rw-r--r--exec.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/exec.go b/exec.go
index 52e358c..dc7563c 100644
--- a/exec.go
+++ b/exec.go
@@ -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