summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2004-04-14 09:14:20 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2004-04-14 09:14:20 +0000
commit217442ffc72bdb98e1eb9723193fa8e66a65d280 (patch)
treef09d74b86cc8160e986abc3a90204f311704cdbb
parent8b398a21765fe2d5d0ccfcbdaaa98437422b7397 (diff)
Don't forget to move to STATE_RUN if the -w output file is stdout.
ok canacar@
-rw-r--r--usr.sbin/tcpdump/privsep_pcap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/tcpdump/privsep_pcap.c b/usr.sbin/tcpdump/privsep_pcap.c
index e4edb473b40..18747bcc776 100644
--- a/usr.sbin/tcpdump/privsep_pcap.c
+++ b/usr.sbin/tcpdump/privsep_pcap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep_pcap.c,v 1.3 2004/04/08 12:38:00 avsm Exp $ */
+/* $OpenBSD: privsep_pcap.c,v 1.4 2004/04/14 09:14:19 otto Exp $ */
/*
* Copyright (c) 2004 Can Erkin Acar
@@ -483,9 +483,10 @@ priv_pcap_dump_open(pcap_t *p, char *fname)
if (priv_fd < 0)
errx(1, "%s: called from privileged portion\n", __func__);
- if (fname[0] == '-' && fname[1] == '\0')
+ if (fname[0] == '-' && fname[1] == '\0') {
f = stdout;
- else {
+ priv_init_done();
+ } else {
write_command(priv_fd, PRIV_OPEN_OUTPUT);
fd = receive_fd(priv_fd);
must_read(priv_fd, &err, sizeof(err));