From: Paul Hänsch Date: Thu, 9 May 2019 14:03:22 +0000 (+0200) Subject: function for providing file transaction IDs X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=2638ffcf8dc901606f3cdb249fab75e14ca47875;p=cgilite function for providing file transaction IDs --- diff --git a/session.sh b/session.sh index 25a6598..5bf8fad 100755 --- a/session.sh +++ b/session.sh @@ -41,6 +41,15 @@ timeid(){ checkid(){ grep -m 1 -xE '[0-9a-zA-Z:=]{16}'; } +transid(){ + # transaction ID to modify a given file + local file="$1" + { stat -c %F%i%n%N%s%Y "$file" 2>&- + printf %s "$SESSION_ID" + server_key + } | sha256sum | cut -d\ -f1 +} + update_session(){ local session sid time sig serverkey checksig