Files
vt1200/lat/probe/run_latd_fuzz.sh

23 lines
799 B
Bash
Executable File

#!/bin/sh
# Run the patched latd with the malformed-RUN probe armed.
#
# LATD_FUZZ=<claimed-slots> ./run_latd_fuzz.sh [normal latd args]
#
# On the FIRST circuit-timer tick of a live circuit, latd emits one RUN
# message that claims <claimed-slots> slots while carrying a single 4-byte
# slot. The VT1200's demultiplexer walks nbr_slots with no length bound, so
# it walks off the end of the received buffer.
#
# Typical:
# LATD_FUZZ=255 ./run_latd_fuzz.sh -d -v -ienp197s0f3u1 -sVT1200 -lestderr
#
set -e
HERE=$(cd "$(dirname "$0")" && pwd)
LATD="$HERE/../local/build/latd"
[ -x "$LATD" ] || { echo "latd not built at $LATD" >&2; exit 1; }
: "${LATD_FUZZ:=255}"
export LATD_FUZZ
echo "probe armed: LATD_FUZZ=$LATD_FUZZ (one malformed RUN on first circuit tick)" >&2
exec sudo -E "$LATD" "$@"