]> The Tcpdump Group git mirrors - tcpdump/blobdiff - tcpdump.c
Merge pull request #588 from glebius/casper
[tcpdump] / tcpdump.c
index a0c273af86282a779f5f7684349b98420567dc96..2bfc6b0f2cf5ef864c501a747ed83d8d40665f06 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -1899,7 +1899,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");