]> The Tcpdump Group git mirrors - libpcap/commitdiff
Catch another place where you could get told "no, you may not open that
authorguy <guy>
Thu, 10 Apr 2008 00:50:34 +0000 (00:50 +0000)
committerguy <guy>
Thu, 10 Apr 2008 00:50:34 +0000 (00:50 +0000)
device" and arrange that PCAP_ERROR_PERM_DENIED be returned.

pcap-dlpi.c

index 0e892637175a93c36c2646df24aef8457b7f6b95..ba1b1fbe0cf8b81ee33d588e4187d29480ef2c40 100644 (file)
@@ -70,7 +70,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap-dlpi.c,v 1.125 2008-04-09 22:02:44 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap-dlpi.c,v 1.126 2008-04-10 00:50:34 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -445,6 +445,8 @@ pcap_activate_dlpi(pcap_t *p)
        /* Try device without unit number */
        if ((p->fd = open(dname, O_RDWR)) < 0) {
                if (errno != ENOENT) {
+                       if (errno == EACCES)
+                               status = PCAP_ERROR_PERM_DENIED;
                        snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "%s: %s", dname,
                            pcap_strerror(errno));
                        goto bad;