aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/kismet
diff options
context:
space:
mode:
authorBrendan Fabeny <bf@FreeBSD.org>2011-05-21 11:21:59 +0000
committerBrendan Fabeny <bf@FreeBSD.org>2011-05-21 11:21:59 +0000
commit93d84d3172c65ae6fd461127b99f5d43bf7b6a6f (patch)
tree83e6ea541793f657e048f086a8947210ca5fe22d /net-mgmt/kismet
parent14ed37f49b2aedd8a03efcf004cf5a304efd6dda (diff)
downloadports-93d84d3172c65ae6fd461127b99f5d43bf7b6a6f.tar.gz
ports-93d84d3172c65ae6fd461127b99f5d43bf7b6a6f.zip
Simplify the WITH_SETUID option by using
GROUPS, rather than PKG[DE]INSTALL scripts
Notes
Notes: svn path=/head/; revision=274406
Diffstat (limited to 'net-mgmt/kismet')
-rw-r--r--net-mgmt/kismet/Makefile12
-rw-r--r--net-mgmt/kismet/files/suid_pkg-message.in8
-rw-r--r--net-mgmt/kismet/suid_pkg-deinstall51
-rw-r--r--net-mgmt/kismet/suid_pkg-install22
4 files changed, 6 insertions, 87 deletions
diff --git a/net-mgmt/kismet/Makefile b/net-mgmt/kismet/Makefile
index af19aaf68dca..0de44995ef80 100644
--- a/net-mgmt/kismet/Makefile
+++ b/net-mgmt/kismet/Makefile
@@ -51,20 +51,12 @@ CONFIGURE_ARGS+=--disable-pcre
.endif
.ifdef(WITH_SETUID)
-KISMET_GROUP?= kismet
-CONFIGURE_ARGS+=--with-suidgroup=${KISMET_GROUP}
+GROUPS = kismet
+CONFIGURE_ARGS+=--with-suidgroup=${GROUPS}
INSTALL_TARGET = suidinstall
PLIST_SUB+= SUID=""
-PKGINSTALL= ${PKGDIR}/suid_pkg-install
-PKGDEINSTALL = ${PKGDIR}/suid_pkg-deinstall
PKGMESSAGE= ${WRKDIR}/suid_pkg-message
SUB_FILES+= suid_pkg-message
-SUB_LIST+= KISMET_GROUP=${KISMET_GROUP}
-
-pre-su-install:
- @${SETENV} PKG_PREFIX=${PREFIX} ${SH} \
- ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
-
.else
INSTALL_TARGET = install
CONFIGURE_ARGS+=--without-suidgroup
diff --git a/net-mgmt/kismet/files/suid_pkg-message.in b/net-mgmt/kismet/files/suid_pkg-message.in
index 1deb307deb85..968c45cde5fe 100644
--- a/net-mgmt/kismet/files/suid_pkg-message.in
+++ b/net-mgmt/kismet/files/suid_pkg-message.in
@@ -1,6 +1,6 @@
-Kismet has been installed with a setuid-root capture helper binary,
+kismet has been installed with a setuid-root capture helper binary,
%%LOCALBASE%%/bin/kismet_capture, which may be executed by users in the
-group %%KISMET_GROUP%%. USERS IN THIS GROUP WILL BE ABLE TO ALTER NETWORK
-INTERFACE STATES, but this is more secure than running all of Kismet
-as root. ONLY users in this group will be able to run Kismet and capture
+kismet group. USERS IN THIS GROUP WILL BE ABLE TO ALTER NETWORK
+INTERFACE STATES, but this is more secure than running all of kismet
+as root. ONLY users in this group will be able to run kismet and capture
from physical network devices.
diff --git a/net-mgmt/kismet/suid_pkg-deinstall b/net-mgmt/kismet/suid_pkg-deinstall
deleted file mode 100644
index 77a736b8092f..000000000000
--- a/net-mgmt/kismet/suid_pkg-deinstall
+++ /dev/null
@@ -1,51 +0,0 @@
-#! /bin/sh
-#
-# taken from net/cvsup-mirror
-
-PATH=/bin:/usr/sbin
-KISMET_GROUP=${KISMET_GROUP:-kismet}
-
-ask() {
- local question default answer
-
- question=$1
- default=$2
- if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
- read -p "${question} [${default}]? " answer
- fi
- if [ x${answer} = x ]; then
- answer=${default}
- fi
- echo ${answer}
-}
-
-yesno() {
- local dflt question answer
-
- question=$1
- dflt=$2
- while :; do
- answer=$(ask "${question}" "${dflt}")
- case "${answer}" in
- [Yy]*) return 0;;
- [Nn]*) return 1;;
- esac
- echo "Please answer yes or no."
- done
-}
-
-delete_group() {
- local g
-
- g=$1
- if yesno "Do you want me to remove group \"${g}\"" y; then
- pw groupdel -n ${g}
- echo "Done."
- fi
-}
-
-if [ x$2 != xDEINSTALL ]; then
- exit
-fi
-
-delete_group ${KISMET_GROUP}
diff --git a/net-mgmt/kismet/suid_pkg-install b/net-mgmt/kismet/suid_pkg-install
deleted file mode 100644
index ebe3671e53df..000000000000
--- a/net-mgmt/kismet/suid_pkg-install
+++ /dev/null
@@ -1,22 +0,0 @@
-#! /bin/sh
-
-PATH=/bin:/usr/sbin
-KISMET_GROUP=${KISMET_GROUP:-kismet}
-KISMET_GID=${KISMET_GID:-229}
-
-case $2 in
-PRE-INSTALL)
-
- if pw group show "${KISMET_GROUP}" 2>/dev/null; then
- echo "You already have a group \"${KISMET_GROUP}\", so I will use it."
- else
- if pw groupadd ${KISMET_GROUP} -g ${KISMET_GID}; then
- echo "Added group \"${KISMET_GROUP}\"."
- else
- echo "Adding group \"${KISMET_GROUP}\" failed..."
- exit 1
- fi
- fi
-
- ;;
-esac