svn commit: r283583 - stable/10/contrib/tcpdump

Luigi Rizzo luigi at FreeBSD.org
Tue May 26 21:12:03 UTC 2015


Author: luigi
Date: Tue May 26 21:12:02 2015
New Revision: 283583
URL: https://svnweb.freebsd.org/changeset/base/283583

Log:
  MFC: 272451, 272653 add CAP_EVENT so that we can poll() on netmap and pcap
  file descriptors

Modified:
  stable/10/contrib/tcpdump/tcpdump.c

Modified: stable/10/contrib/tcpdump/tcpdump.c
==============================================================================
--- stable/10/contrib/tcpdump/tcpdump.c	Tue May 26 21:03:41 2015	(r283582)
+++ stable/10/contrib/tcpdump/tcpdump.c	Tue May 26 21:12:02 2015	(r283583)
@@ -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");


More information about the svn-src-all mailing list