#!/bin/bash # Code replay of the author's check16.py (report iis:2611.00054) in the clean environment. # The clean environment has no variable that can hold a secret. # usage: bash work/capset/q0003/run_replay_check16.sh W=$(cd "$(dirname "$0")/../../.." && pwd) # the root of the workspace; this script is in work/capset/q0003 SRC=$W/work/capset/downloads/q3_author/check16.py LOG=$W/work/capset/q0003/logs/replay_check16.log mkdir -p "$W/work/capset/q0003/logs" { echo "start $(date -u +%Y-%m-%dT%H:%M:%SZ)" echo "source sha256 $(shasum -a 256 "$SRC" | cut -d' ' -f1)" /bin/bash -c '. "$1/work/lean_env.sh" && cd "$1/work/capset/q0003" && /usr/bin/time -p python3 -I "$2"' replay "$W" "$SRC" echo "exit code $?" echo "end $(date -u +%Y-%m-%dT%H:%M:%SZ)" } > "$LOG" 2>&1