NetBSD Problem Report #50248
From www@NetBSD.org Tue Sep 15 08:28:39 2015
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 34820A5864
for <gnats-bugs@gnats.NetBSD.org>; Tue, 15 Sep 2015 08:28:39 +0000 (UTC)
Message-Id: <20150915082837.125F1A65B8@mollari.NetBSD.org>
Date: Tue, 15 Sep 2015 08:28:37 +0000 (UTC)
From: nonakap@gmail.com
Reply-To: nonakap@gmail.com
To: gnats-bugs@NetBSD.org
Subject: tcpdump -w don't work.
X-Send-Pr-Version: www-1.0
>Number: 50248
>Category: bin
>Synopsis: tcpdump -w don't work.
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Sep 15 08:30:00 +0000 2015
>Closed-Date: Thu Sep 17 14:13:07 +0000 2015
>Last-Modified: Thu Sep 17 14:13:07 +0000 2015
>Originator: NONAKA Kimihiro
>Release: HEAD 20150915
>Organization:
>Environment:
NetBSD netbsd 7.99.21 NetBSD 7.99.21 (KOHARU) #41: Tue Sep 15 12:08:42 JST 2015 nonaka@netbsd:/home/snapshot/NetBSD/HEAD.20150827/obj.NetBSD-amd64/amd64/sys/arch/amd64/compile/KOHARU amd64
>Description:
# tcpdump -w xxx.pcap
tcpdump: xxx.pcap: Permission denied
# tcpdump -w ~/xxx.pcap
tcpdump: /home/nonaka/xxx.pcap: No such file or directory
Failed to open the xxx.pcap file because try it after chroot(2).
>How-To-Repeat:
tcpdump -w xxx.pcap
>Fix:
Re-apply src/external/bsd/tcpdump/dist/tcpdump.c rev.1.8.
diff --git a/external/bsd/tcpdump/dist/tcpdump.c b/external/bsd/tcpdump/dist/tcpdump.c
index 2555495..009f294 100644
--- a/external/bsd/tcpdump/dist/tcpdump.c
+++ b/external/bsd/tcpdump/dist/tcpdump.c
@@ -1857,6 +1857,9 @@ main(int argc, char **argv)
capng_apply(CAPNG_SELECT_BOTH);
#endif /* HAVE_LIBCAP_NG */
if (username || chroot_dir)
+#ifndef HAVE_LIBCAP_NG
+ if (!WFileName)
+#endif
droproot(username, chroot_dir);
}
#endif /* WIN32 */
>Release-Note:
>Audit-Trail:
From: "NONAKA Kimihiro" <nonaka@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/50248 CVS commit: src/external/bsd/tcpdump/dist
Date: Thu, 17 Sep 2015 14:03:10 +0000
Module Name: src
Committed By: nonaka
Date: Thu Sep 17 14:03:10 UTC 2015
Modified Files:
src/external/bsd/tcpdump/dist: tcpdump.c
Log Message:
PR/50248: re-apply src/external/bsd/tcpdump/dist/tcpdump.c rev.1.8.
> When running as root and wanting to write a file and not having CAPNG, don't
> drop privs, because we cannot open the file if we drop privs.
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/tcpdump/dist/tcpdump.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: nonaka@NetBSD.org
State-Changed-When: Thu, 17 Sep 2015 14:13:07 +0000
State-Changed-Why:
Applied src/external/bsd/tcpdump/dist/tcpdump.c rev.1.8.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.