]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Clean up Capsicum rights setting a bit.
authorGuy Harris <[email protected]>
Mon, 9 Mar 2015 22:34:03 +0000 (15:34 -0700)
committerGuy Harris <[email protected]>
Wed, 11 Mar 2015 06:04:43 +0000 (23:04 -0700)
Rename set_dump_fd_capsicum_rights() to set_dumper_capsicum_rights() and
have it take a pcap_dumper_t * as an argument and extract the file
descriptor itself, rather than having the caller do so.

This fixes a syntax error in one of the calls.

tcpdump.c

index 3803fd944eab5e00ee34bd8f5ff5f6a638905fbb..2b71d27deb171d8d9d35746fa9a5276065287b07 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -980,8 +980,9 @@ tstamp_precision_to_string(int precision)
  *        what the standard I/O library happens to require this week.
  */
 static void
  *        what the standard I/O library happens to require this week.
  */
 static void
-set_dump_fd_capsicum_rights(int fd)
+set_dumper_capsicum_rights(pcap_dumper_t *p)
 {
 {
+       int fd = fileno(pcap_dump_file(p));
        cap_rights_t rights;
 
        cap_rights_init(&rights, CAP_SEEK, CAP_WRITE, CAP_FCNTL);
        cap_rights_t rights;
 
        cap_rights_init(&rights, CAP_SEEK, CAP_WRITE, CAP_FCNTL);
@@ -1894,7 +1895,7 @@ main(int argc, char **argv)
                if (p == NULL)
                        error("%s", pcap_geterr(pd));
 #ifdef HAVE_CAPSICUM
                if (p == NULL)
                        error("%s", pcap_geterr(pd));
 #ifdef HAVE_CAPSICUM
-               set_dump_fd_capsicum_rights(fileno(pcap_dump_file(p)));
+               set_dumper_capsicum_rights(p);
 #endif
                if (Cflag != 0 || Gflag != 0) {
 #ifdef HAVE_CAPSICUM
 #endif
                if (Cflag != 0 || Gflag != 0) {
 #ifdef HAVE_CAPSICUM
@@ -2329,7 +2330,7 @@ dump_packet_and_trunc(u_char *user, const struct pcap_pkthdr *h, const u_char *s
                        if (dump_info->p == NULL)
                                error("%s", pcap_geterr(pd));
 #ifdef HAVE_CAPSICUM
                        if (dump_info->p == NULL)
                                error("%s", pcap_geterr(pd));
 #ifdef HAVE_CAPSICUM
-                       set_dump_fd_capsicum_rights(pcap_dump_file(dump_info->p)));
+                       set_dumper_capsicum_rights(dump_info->p);
 #endif
                }
        }
 #endif
                }
        }
@@ -2400,7 +2401,7 @@ dump_packet_and_trunc(u_char *user, const struct pcap_pkthdr *h, const u_char *s
                        if (dump_info->p == NULL)
                                error("%s", pcap_geterr(pd));
 #ifdef HAVE_CAPSICUM
                        if (dump_info->p == NULL)
                                error("%s", pcap_geterr(pd));
 #ifdef HAVE_CAPSICUM
-                       set_dump_fd_capsicum_rights(fileno(pcap_dump_file(dump_info->p)));
+                       set_dumper_capsicum_rights(dump_info->p);
 #endif
                }
        }
 #endif
                }
        }