DragonFlyBSD Kernel Audit
DF-0612 / build.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-0612 harness build.  The harness is a userspace replica of the exact
# kernel struct layouts and the buggy setbit() line; it must be built in the
# guest so the verbatim sys/ header resolves.  Run as root (needs /usr/src).
set -e
HERE=$(dirname "$0")
# Resolve an absolute path
case "$HERE" in
  /*) ABSDIR="$HERE" ;;
  *)  ABSDIR="$(pwd)/$HERE" ;;
esac
mkdir -p /root/df0612
cp /usr/src/sys/netproto/802_11/ieee80211_tdma.h /root/df0612/
cp "$ABSDIR/harness.c" /root/df0612/harness.c
cd /root/df0612
cc -O2 -Wall -o harness harness.c
echo "built /root/df0612/harness"