[PATCH 2 of 2] Fix append-sig.sh to use a temporary file to insert the signature time
Wald Commits
scm-commit at wald.intevation.org
Mon Nov 24 14:43:47 CET 2014
# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1416836616 -3600
# Node ID 289cb3554c55bb90920a00f767c85800b21c925a
# Parent 948f03bb52549edd5790df60746fc356f2773721
Fix append-sig.sh to use a temporary file to insert the signature time
diff -r 948f03bb5254 -r 289cb3554c55 ui/tests/append-sig.sh
--- a/ui/tests/append-sig.sh Mon Nov 24 14:43:10 2014 +0100
+++ b/ui/tests/append-sig.sh Mon Nov 24 14:43:36 2014 +0100
@@ -1,6 +1,9 @@
#!/bin/bash
-cp "$2" "$3"
+TMPFILE=$(mktemp)
+cp "$2" "$TMPFILE"
CUR_DT=$(date +%s)
-sed -i "s/###SIGNATURE_DATE###/${CUR_DT}/" "$3"
-echo -e \\r\\nS_DT:$CUR_DT >> "$3"
-echo -e \\r\\nS:$(openssl dgst -sha256 -sign "$1" < "$2" | base64 -w0) >> "$3"
+sed -i "s/###SIGNATURE_DATE###/${CUR_DT}/" "$TMPFILE"
+echo -e \\r\\nS_DT:$CUR_DT >> "$TMPFILE"
+cp "$TMPFILE" "$3"
+echo -e \\r\\nS:$(openssl dgst -sha256 -sign "$1" < "$TMPFILE" | base64 -w0) >> "$3"
+rm "$TMPFILE"
More information about the Trustbridge-commits
mailing list