#!/bin/sh
# DF-2262 run.sh — run the cookie-poison trigger AS ROOT (panics the kernel).
# As the unprivileged user maxx this prints the permission gate instead.
set -e
id
if [ "$(id -u)" != "0" ]; then
  echo "--- unprivileged actor: /dev/xpt0 is mode 0600 root:operator ---"
  ls -la /dev/xpt0
  echo "(no access -> bug is permission-gated for unprivileged users; nothing to exploit)"
  camcontrol devlist 2>&1 | head -1
  exit 0
fi
echo "=== ROOT run: issuing poisoned XPT_DEV_MATCH; expect kernel panic ==="
./xpt_devmatch_poison
