From: Luigi Rizzo Date: Thu, 2 Oct 2014 21:34:52 +0000 (+0000) Subject: add CAP_EVENT for the libpcap device X-Git-Tag: tcpdump-4.99-bp~2092 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/8830c2865ebfa133d526771a5ade95c870aab560?ds=sidebyside add CAP_EVENT for the libpcap device ...so we will be able to use pcap-netmap, which does poll() on the file descriptor. --- diff --git a/tcpdump.c b/tcpdump.c index 73bf1387..e26fbafd 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -1855,7 +1855,12 @@ main(int argc, char **argv) if (RFileName == NULL && VFileName == NULL) { static const unsigned long cmds[] = { BIOCGSTATS, BIOCROTZBUF }; - cap_rights_init(&rights, CAP_IOCTL, CAP_READ); + /* + * The various libpcap devices use a combination of + * read (bpf), ioctl (bpf, netmap), poll (netmap) + * so we add the relevant access rights. + */ + cap_rights_init(&rights, CAP_IOCTL, CAP_READ, CAP_EVENT); if (cap_rights_limit(pcap_fileno(pd), &rights) < 0 && errno != ENOSYS) { error("unable to limit pcap descriptor");