OpenBSD CVS

CVS log for src/usr.sbin/tcpdump/privsep_pcap.c


[BACK] Up to [local] / src / usr.sbin / tcpdump

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.25 / (download) - annotate - [select for diffs], Fri Jun 28 13:32:51 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, HEAD
Changes since 1.24: +11 -11 lines
Diff to previous 1.24 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.24 / (download) - annotate - [select for diffs], Mon Mar 18 00:09:22 2019 UTC (5 years, 2 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.23: +7 -3 lines
Diff to previous 1.23 (colored)

support configuring BIOCSFILDROP with tcpdump.

this allows tcpdump to be used a quick and dirty firewall. it also
looks like an amazing foot-gun, so be careful.

for example `tcpdump -B drop -i ix1 udp and port 7` lets you
completely drop discard packets in the hardware interrupt handler.

ok sthen@ mikeb@ claudio@ visa@

Revision 1.23 / (download) - annotate - [select for diffs], Sat Nov 17 16:52:02 2018 UTC (5 years, 6 months ago) by brynet
Branch: MAIN
Changes since 1.22: +4 -4 lines
Diff to previous 1.22 (colored)

tcpdump(8) monitor process privdrop

The privsep monitor process handles all privileged operations on behalf
of the unprivileged "packet parser" process. Once it enters its runtime
state, it only needs to:

* Perform DNS and other "numbers to names" lookups, sending results
back over a pipe/socketpair.
* Display the final packet statistics on ^C.

We can finally now drop root privileges in this process as well, as bpf
BIOCGSTATS is still permitted by non-root on open descriptors after it
has been permanently locked with BIOCLOCK. This provides some additional
protection, to go along with the already tight unveil(2) and pledge(2)
restrictions.

With this change tcpdump(8) completely drops root privileges at runtime.

ok mestre@, deraadt@

Revision 1.22 / (download) - annotate - [select for diffs], Wed Apr 19 05:36:13 2017 UTC (7 years, 1 month ago) by natano
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

Switch base tools from /dev/bpf0 to /dev/bpf. Now that /dev/bpf has been
around for two releases, it should be safe to do so.

ok bluhm deraadt sthen tb yasuoka

Revision 1.21 / (download) - annotate - [select for diffs], Sun May 8 08:20:50 2016 UTC (8 years, 1 month ago) by natano
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

Use /dev/bpf0 instead of /dev/bpf (without loop though), as suggested by
sthen@. to make remote upgrades without media less painful.

ok tb@

Revision 1.20 / (download) - annotate - [select for diffs], Tue May 3 07:41:24 2016 UTC (8 years, 1 month ago) by natano
Branch: MAIN
Changes since 1.19: +3 -9 lines
Diff to previous 1.19 (colored)

Move to /dev/bpf; ok lteo

Revision 1.19 / (download) - annotate - [select for diffs], Thu Oct 1 13:18:40 2015 UTC (8 years, 8 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.18: +1 -14 lines
Diff to previous 1.18 (colored)

remove a bsdi ifdef path
"kill it with fire" deraadt@

Revision 1.18 / (download) - annotate - [select for diffs], Fri Aug 21 02:07:32 2015 UTC (8 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.17: +5 -5 lines
Diff to previous 1.17 (colored)

since stdlib.h is in scope, don't cast.... you know the drill.
no sneakiness detected by krw

Revision 1.17 / (download) - annotate - [select for diffs], Wed Nov 14 03:33:04 2012 UTC (11 years, 6 months ago) by lteo
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.16: +4 -2 lines
Diff to previous 1.16 (colored)

In the unlikely event that a NULL device is passed to priv_pcap_live(),
ensure that the function will stop and return NULL instead of continuing
(which could lead to a segfault).

ok benno deraadt otto

Revision 1.16 / (download) - annotate - [select for diffs], Tue Sep 21 04:08:12 2010 UTC (13 years, 8 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.15: +5 -1 lines
Diff to previous 1.15 (colored)

temporary hack to raise snaplen for pflog so that pflog header, ip header
and protocol header actually fit in the common cases.
stays until canacar tells us how to do it right ;)
ok dlg ryan

Revision 1.15 / (download) - annotate - [select for diffs], Fri Apr 18 21:35:11 2008 UTC (16 years, 1 month ago) by djm
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.14: +7 -3 lines
Diff to previous 1.14 (colored)

add filtering on direction; ok mpf@ deraadt@ feedback jmc@

Revision 1.14 / (download) - annotate - [select for diffs], Sun Nov 13 19:37:50 2005 UTC (18 years, 7 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.13: +4 -4 lines
Diff to previous 1.13 (colored)

Do not clobber errno, from Andrey Matveev. ok canacar@

Revision 1.13 / (download) - annotate - [select for diffs], Sun Oct 16 18:23:45 2005 UTC (18 years, 7 months ago) by otto
Branch: MAIN
Changes since 1.12: +6 -11 lines
Diff to previous 1.12 (colored)

Simplify some error paths. From Andrey Matveev. ok canacar@

Revision 1.12 / (download) - annotate - [select for diffs], Thu Sep 29 18:45:32 2005 UTC (18 years, 8 months ago) by canacar
Branch: MAIN
Changes since 1.11: +4 -4 lines
Diff to previous 1.11 (colored)

Change DLT earlier. Fixes the loss of promisc mode when a non-default
DLT is specified.
looks sane deraadt@

Revision 1.11 / (download) - annotate - [select for diffs], Tue Sep 27 18:31:17 2005 UTC (18 years, 8 months ago) by otto
Branch: MAIN
Changes since 1.10: +6 -5 lines
Diff to previous 1.10 (colored)

Fix another case of inconstitent error handling that was missed in the
previous commit.
ok moritz@

Revision 1.10 / (download) - annotate - [select for diffs], Mon Sep 26 19:30:48 2005 UTC (18 years, 8 months ago) by otto
Branch: MAIN
Changes since 1.9: +10 -6 lines
Diff to previous 1.9 (colored)

If setting the filter fails, pass the error back;
ok deraadt@

Revision 1.9 / (download) - annotate - [select for diffs], Sun May 22 19:53:33 2005 UTC (19 years ago) by moritz
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.8: +4 -4 lines
Diff to previous 1.8 (colored)

correct comments and function namens to reflect new parent/child
situation. suggested by and ok otto@

Revision 1.8 / (download) - annotate - [select for diffs], Wed Mar 30 22:18:16 2005 UTC (19 years, 2 months ago) by moritz
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

remove trailing \n in errx().
ok deraadt@

Revision 1.7 / (download) - annotate - [select for diffs], Sun Mar 6 18:44:50 2005 UTC (19 years, 3 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.6: +8 -3 lines
Diff to previous 1.6 (colored)

add support for multiple DLTs using the -L and -y options.

ok canacar@

Revision 1.6 / (download) - annotate - [select for diffs], Thu Apr 29 04:19:37 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.5: +10 -14 lines
Diff to previous 1.5 (colored)

a slight polishing...

Revision 1.5 / (download) - annotate - [select for diffs], Wed Apr 28 20:05:07 2004 UTC (20 years, 1 month ago) by canacar
Branch: MAIN
Changes since 1.4: +8 -3 lines
Diff to previous 1.4 (colored)

Fix fd leaks.
Found by and ok deraadt@

Revision 1.4 / (download) - annotate - [select for diffs], Wed Apr 14 09:14:19 2004 UTC (20 years, 2 months ago) by otto
Branch: MAIN
Changes since 1.3: +4 -3 lines
Diff to previous 1.3 (colored)

Don't forget to move to STATE_RUN if the -w output file is stdout.
ok canacar@

Revision 1.3 / (download) - annotate - [select for diffs], Thu Apr 8 12:38:00 2004 UTC (20 years, 2 months ago) by avsm
Branch: MAIN
Changes since 1.2: +3 -2 lines
Diff to previous 1.2 (colored)

only close fd if its valid, from Moritz Jodeit <moritz at jodeit.org>
canacar@ ok

Revision 1.2 / (download) - annotate - [select for diffs], Thu Feb 5 22:12:06 2004 UTC (20 years, 4 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.1: +17 -6 lines
Diff to previous 1.1 (colored)

Don't print two confusing error messages, print a single clear one.
ok deraadt@ hshoexer@ avsm@

Revision 1.1 / (download) - annotate - [select for diffs], Wed Jan 28 19:44:55 2004 UTC (20 years, 4 months ago) by canacar
Branch: MAIN

privilege separated tcpdump, joint work with otto@

tested by avsm@ vincent@ dhartmei@ markus@ hshoexer@ and others
go for it deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.