summaryrefslogtreecommitdiffstats
path: root/contrib/tcpdump
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2015-05-26 21:12:02 +0000
committerluigi <luigi@FreeBSD.org>2015-05-26 21:12:02 +0000
commitcf32ec5d9e659f5dff78c9e333977f5cf367d59f (patch)
treebec0e06e281a6b5297dcd814b886f1c1ace96e33 /contrib/tcpdump
parentfcb7b0e8b6ce080c051aa41f7e7d802560bf222c (diff)
downloadFreeBSD-src-cf32ec5d9e659f5dff78c9e333977f5cf367d59f.zip
FreeBSD-src-cf32ec5d9e659f5dff78c9e333977f5cf367d59f.tar.gz
MFC: 272451, 272653 add CAP_EVENT so that we can poll() on netmap and pcap
file descriptors
Diffstat (limited to 'contrib/tcpdump')
-rw-r--r--contrib/tcpdump/tcpdump.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/tcpdump/tcpdump.c b/contrib/tcpdump/tcpdump.c
index 511e1af..9c5e960 100644
--- a/contrib/tcpdump/tcpdump.c
+++ b/contrib/tcpdump/tcpdump.c
@@ -1486,7 +1486,12 @@ main(int argc, char **argv)
if (RFileName == NULL && VFileName == NULL) {
static const unsigned long cmds[] = { BIOCGSTATS };
- cap_rights_init(&rights, CAP_IOCTL, CAP_READ);
+ /*
+ * The various libpcap devices use a combination of
+ * read (bpf), ioctl (bpf, netmap), poll (netmap).
+ * Grant the relevant access rights, sorted by name.
+ */
+ cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ);
if (cap_rights_limit(pcap_fileno(pd), &rights) < 0 &&
errno != ENOSYS) {
error("unable to limit pcap descriptor");
OpenPOWER on IntegriCloud