NetBSD Problem Report #48554

From  Mon Jan 27 12:36:43 2014
Return-Path: <>
Received: from ( [])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "", Issuer "Postmaster" (not verified))
	by (Postfix) with ESMTPS id 1AAA4A647A
	for <>; Mon, 27 Jan 2014 12:36:43 +0000 (UTC)
Message-Id: <>
Date: Mon, 27 Jan 2014 13:36:33 CET
Subject: tcpdump -w does not work
X-Send-Pr-Version: 3.95

>Number:         48554
>Category:       bin
>Synopsis:       tcpdump -w does not work
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 27 12:40:00 +0000 2014
>Closed-Date:    Thu Mar 17 06:22:58 +0000 2022
>Last-Modified:  Thu Mar 17 06:22:58 +0000 2022
>Originator:     Martin Husemann
>Release:        NetBSD 6.99.30
The NetBSD Foundation, Inc.
System: NetBSD 6.99.30 NetBSD 6.99.30 (NIGHT-OWL) #223: Sun Jan 26 12:14:48 CET 2014 amd64
Architecture: x86_64
Machine: amd64

tcpdump is unable to write capture files (for further analysis with wireshark
for example):

 # tcpdump -i wm0 -w /tmp/client.cap
 tcpdump: /tmp/client.cap: No such file or directory

checking ktrace output shows that at the time of the open() call, tcpdump
is already chrooted to /var/chroot/tcpdump (which is owned by root and mode
0755), and also setuser _tcpdump. This causes even local paths (./client.cap)
to fail.

Tcpdump should open the output file before the chroot, everything else is
going to confuse the user.




From: Martin Husemann <>
Subject: Re: bin/48554: tcpdump -w does not work
Date: Mon, 27 Jan 2014 13:52:36 +0000

 On Mon, Jan 27, 2014 at 12:40:00PM +0000, wrote:
 > Tcpdump should open the output file before the chroot, everything else is
 > going to confuse the user.

 bad@ points out that the -C option makes this aproach non trivial, so
 proper priv separation would be needed.


From: =?UTF-8?Q?Guillaume_DUAL=C3=89?= <>
Subject: Re: bin/48554
Date: Wed, 16 Mar 2022 22:36:19 +0100

 I just tried, with root user, this command  "tcpdump -w /tmp/poc.cap"
 with a fresh NetBSD 9.2 box, and it's working fine!
 Maybe you can close the bug?
 Best regards,

State-Changed-From-To: open->closed
State-Changed-When: Thu, 17 Mar 2022 06:22:58 +0000
This has been fixed


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.