Commit 065e6c83 authored by Vojtech Myslivec's avatar Vojtech Myslivec 🚀

Prevent cache read race condition

parent d0be148c
......@@ -57,8 +57,9 @@ cache_set() {
local value="$2"
local hash=$(hash_string "$value")
echo "$value" > "$CRYPTO_WRAPPER_ROOT/key_$key"
# key is read first so hash must be written before the key
echo "$value" > "$CRYPTO_WRAPPER_ROOT/hash_$hash"
echo "$value" > "$CRYPTO_WRAPPER_ROOT/key_$key"
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment