From 2638ffcf8dc901606f3cdb249fab75e14ca47875 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Thu, 9 May 2019 16:03:22 +0200 Subject: [PATCH] function for providing file transaction IDs --- session.sh | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- 2.39.2