Skip to content

Commit b5a602a

Browse files
hselaskyinfrastation
authored andcommitted
Fix for backends which doesn't support capsicum.
Not all libpcap backends use the BPF compatible set of IOCTLs. For example the mlx5 backend uses libibverbs which is currently not capsicum compatible. Disable sandboxing for such backends. Completes commit 3e26499 Signed-off-by: Hans Petter Selasky <[email protected]>
1 parent 2c4968b commit b5a602a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tcpdump.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2628,6 +2628,9 @@ DIAG_ON_ASSIGN_ENUM
26282628
#else
26292629
cansandbox = (cansandbox && ndo->ndo_nflag);
26302630
#endif /* HAVE_CASPER */
2631+
cansandbox = (cansandbox && (pcap_fileno(pd) != -1 ||
2632+
RFileName != NULL));
2633+
26312634
if (cansandbox && cap_enter() < 0 && errno != ENOSYS)
26322635
error("unable to enter the capability mode");
26332636
#endif /* HAVE_CAPSICUM */

0 commit comments

Comments
 (0)