diff options
author | Sören Tempel <soeren+git@soeren-tempel.net> | 2019-12-19 23:42:57 +0100 |
---|---|---|
committer | Sören Tempel <soeren+git@soeren-tempel.net> | 2020-01-01 12:40:09 +0100 |
commit | 25292898fde6d5aa8791d9411b904c3a3b408c06 (patch) | |
tree | e4a9eb79544cbbd5688066637df9659dee22f1d5 | |
parent | e0241ea300d8c1b0081793ccb4b2c5041ef9bb43 (diff) | |
download | aports-25292898fde6d5aa8791d9411b904c3a3b408c06.tar.bz2 aports-25292898fde6d5aa8791d9411b904c3a3b408c06.tar.xz |
community/wireshark: allow users in wireshark group to use dumpcap
Currently wireshark needs to be either run as root or users need to
manually configure one of the mechanisms from the wireshark wiki [0].
Allowing users of a specific group to capture packets seems to be a
sensible default for me.
[0]: https://wiki.wireshark.org/CaptureSetup/CapturePrivileges#Limiting_capture_permission_to_only_one_group
-rw-r--r-- | community/wireshark/APKBUILD | 12 | ||||
-rw-r--r-- | community/wireshark/wireshark.pre-install | 4 | ||||
l--------- | community/wireshark/wireshark.pre-upgrade | 1 |
3 files changed, 15 insertions, 2 deletions
diff --git a/community/wireshark/APKBUILD b/community/wireshark/APKBUILD index 1467103840..65347889fa 100644 --- a/community/wireshark/APKBUILD +++ b/community/wireshark/APKBUILD @@ -4,17 +4,19 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=wireshark pkgver=3.0.7 -pkgrel=1 +pkgrel=2 pkgdesc="A network protocol analyzer" url="https://www.wireshark.org" arch="all" license="GPL-2.0-or-later" makedepends="bash bison c-ares-dev cmake flex glib glib-dev gnutls-dev - libcap-dev libgcrypt-dev libnl3-dev libpcap-dev + libcap-dev libgcrypt-dev libnl3-dev libcap libpcap-dev lua5.2-dev pcre-dev perl-dev portaudio-dev qt5-qtbase-dev qt5-qtmultimedia-dev qt5-qtsvg-dev qt5-qttools-dev" checkdepends="py3-pytest py3-pytest-xdist" subpackages="$pkgname-dev $pkgname-doc $pkgname-common tshark" +pkggroups="wireshark" +install="$pkgname.pre-install $pkgname.pre-upgrade" # Use mirror in the meantime # source="https://www.wireshark.org/download/src/wireshark-$pkgver.tar.xz source="https://1.as.dl.wireshark.org/src/wireshark-$pkgver.tar.xz @@ -220,6 +222,12 @@ check() { package() { make -j1 DESTDIR="$pkgdir" install + + # Allow users in the wireshark group to capture packages + # See: https://wiki.wireshark.org/CaptureSetup/CapturePrivileges#Limiting_capture_permission_to_only_one_group + chmod 0750 "$pkgdir"/usr/bin/dumpcap + chown root:wireshark "$pkgdir"/usr/bin/dumpcap + setcap cap_net_raw,cap_net_admin+eip "$pkgdir"/usr/bin/dumpcap } common() { diff --git a/community/wireshark/wireshark.pre-install b/community/wireshark/wireshark.pre-install new file mode 100644 index 0000000000..e9022d09cc --- /dev/null +++ b/community/wireshark/wireshark.pre-install @@ -0,0 +1,4 @@ +#!/bin/sh + +addgroup -S wireshark 2>/dev/null +exit 0 diff --git a/community/wireshark/wireshark.pre-upgrade b/community/wireshark/wireshark.pre-upgrade new file mode 120000 index 0000000000..a2ff63bc76 --- /dev/null +++ b/community/wireshark/wireshark.pre-upgrade @@ -0,0 +1 @@ +wireshark.pre-install
\ No newline at end of file |