#!/bin/sh
#
# Abuse wrapper.
# by Joey Hess <joeyh@master.debian.org>

# Change to the directory all the abuse files are in.
cd /usr/lib/games/abuse

# Fix PATH. This closes a security hole which could have netted users a 
# sgid games shell.
PATH=.:/bin:/usr/bin

# Run abuse.
abuse.x11R6 $@

# Kill these processes if they are still running. If abuse exits
# unexpectedly, they are often left running.
killall -KILL lnx_sdrv undrv keydrv >/dev/null 2>/dev/null

# Clean up after the abuse program.
rm -f /tmp/.abuse_ndrv_in /tmp/.abuse_ndrv_out /tmp/.abuse_ndrv_lock \
	/tmp/sfxdrv.command /tmp/sfxdrv.signal
