#!/bin/sh
set -e

if [ ! -f /etc/suid.conf ]; then
    cat > /etc/suid.conf <<EOF
# Configuration File for suid programs or special permissions
#
# The format is:
# package file user group permissions
EOF
fi

if grep -q '^suidmanager /usr/bin/suidexec' /etc/suid.conf; then
    suidunregister /usr/bin/suidexec
elif grep -q '^suidmanager /usr/sbin/suidexec' /etc/suid.conf; then
    suidunregister /usr/sbin/suidexec
fi

# Now it's debhelper's turn.
#DEBHELPER#

if [ "$1" = configure ] && expr match "$2" '0.1[0-8]' >/dev/null; then
echo
echo "*** The suidexec program has been removed from this package due to ***"
echo "*** a security problem.  If you used it in any of your scripts, I  ***"
echo "*** suggest you switch to something more secure, such as perl.     ***"
echo
echo -n "Press <ENTER> to continue."
read
fi
