From 5c1be5ffb392a2bcafea14bbcc45876c2e971d27 Mon Sep 17 00:00:00 2001 From: marcus Date: Mon, 5 Jan 2015 16:37:08 +0000 Subject: Setgid dumpcap to network so non-root users can use wireshark in capture mode. PR: 195435 Submitted by: yuri@rawbw.com No objection from: ports@ --- net/wireshark/Makefile | 4 +++- net/wireshark/files/pkg-message | 17 +++++++++++++++++ net/wireshark/pkg-plist | 4 ++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 net/wireshark/files/pkg-message diff --git a/net/wireshark/Makefile b/net/wireshark/Makefile index 1071095..825edbc 100644 --- a/net/wireshark/Makefile +++ b/net/wireshark/Makefile @@ -3,7 +3,7 @@ PORTNAME?= wireshark PORTVERSION= 1.12.2 -PORTREVISION?= 2 +PORTREVISION?= 3 CATEGORIES= net ipv6 MASTER_SITES= http://www.wireshark.org/download/src/ \ http://ftp.uni-kl.de/pub/wireshark/src/ \ @@ -162,6 +162,8 @@ CONFIGURE_ARGS+=--with-libgcrypt-prefix=${LOCALBASE} CONFIGURE_ARGS+=--with-krb5=no .endif +PKG_MESSAGE= ${FILESDIR}/pkg-message + post-patch: @${REINPLACE_CMD} -e 's|llua|llua-${LUA_VER}|g ; \ s|-DGDK_PIXBUF_DISABLE_DEPRECATED||g ; \ diff --git a/net/wireshark/files/pkg-message b/net/wireshark/files/pkg-message new file mode 100644 index 0000000..962a833 --- /dev/null +++ b/net/wireshark/files/pkg-message @@ -0,0 +1,17 @@ +=============================================================================== + +In order for wireshark be able to capture packets when used by unprivileged +user, /dev/bpf should be in network group and have read-write permissions. +For example: + +# chgrp network /dev/bpf* +# chmod g+r /dev/bpf* +# chmod g+w /dev/bpf* + +In order for this to persist across reboots, add the following to +/etc/devfs.conf: + +own bpf* root:network +perm bpf* 0660 + +=============================================================================== diff --git a/net/wireshark/pkg-plist b/net/wireshark/pkg-plist index c84b8b8..3606739 100644 --- a/net/wireshark/pkg-plist +++ b/net/wireshark/pkg-plist @@ -1,7 +1,11 @@ %%CAPINFOS%% %%CAPTYPE%% %%DFTEST%% +@group network +@mode 2555 bin/dumpcap +@mode +@group %%EDITCAP%% %%WIRESHARK%% %%MERGECAP%% -- cgit v1.1