1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
#!/bin/sh
set -e
# Copied from wireshark-common and modified
. /usr/share/debconf/confmodule
PROGRAM=/usr/bin/kismet_capture
GROUP=kismet
if [ -e "$PROGRAM" ]; then
db_get kismet/install-setuid
if [ "$RET" = "false" ] ; then
echo "Not installing Kismet with suid-root capture helper. Kismet "
echo "must be run with 'sudo'. This is not the preferred nor most secure way "
echo "to install Kismet."
if [ -x /usr/bin/dpkg-statoverride ] && \
! /usr/bin/dpkg-statoverride --list $PROGRAM >/dev/null; then
chown root:root $PROGRAM
chmod u=rwx,go=rx $PROGRAM
fi
else
if [ -x /usr/bin/dpkg-statoverride ] && \
! /usr/bin/dpkg-statoverride --list $PROGRAM >/dev/null; then
addgroup --quiet --system $GROUP
db_get kismet/install-users
if [ "$RET" != "" ]; then
for x in ${RET}; do
usermod -a -G $GROUP $x
done
fi
echo "Installing Kismet with suid-root capture helper ..."
chown root:$GROUP $PROGRAM
chmod u=rwxs,g=rx,o=r $PROGRAM
# Just using capabilities is not enought for kismet, it needs suid anyway
# if which setcap > /dev/null ; then
# echo "... and setting capabilities"
#
# if ! setcap cap_net_raw,cap_net_admin=eip $PROGRAM; then
# echo "Setting capabilities for kismet_capture using Linux Capabilities failed."
# echo "Falling back to setting set-user-id bit."
# else
# chmod u=rwx,go=rx $PROGRAM
# fi
# fi
fi
fi
fi
#DEBHELPER#
|