NetBSD Problem Report #48554

From martin@duskware.de  Mon Jan 27 12:36:43 2014
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 1AAA4A647A
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 27 Jan 2014 12:36:43 +0000 (UTC)
Message-Id: <20140127123633.546A4ED0AF0@emmas.aprisoft.de>
Date: Mon, 27 Jan 2014 13:36:33 CET
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
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
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD night-owl.duskware.de 6.99.30 NetBSD 6.99.30 (NIGHT-OWL) #223: Sun Jan 26 12:14:48 CET 2014 martin@night-owl.duskware.de:/usr/src/sys/arch/amd64/compile/NIGHT-OWL amd64
Architecture: x86_64
Machine: amd64
>Description:

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.

>How-To-Repeat:
s/a

>Fix:
n/a

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
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, martin@NetBSD.org 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.

 Martin

From: =?UTF-8?Q?Guillaume_DUAL=C3=89?= <guillaume.duale@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/48554
Date: Wed, 16 Mar 2022 22:36:19 +0100

 Hello,
 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,
 Guillaume.

State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Thu, 17 Mar 2022 06:22:58 +0000
State-Changed-Why:
This has been fixed


>Unformatted:

NetBSD Home
NetBSD PR Database Search

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