From nobody Thu Sep 14 23:54:33 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RmvLf6dpyz4t5lg for ; Thu, 14 Sep 2023 23:54:34 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RmvLf2HTfz3bDT for ; Thu, 14 Sep 2023 23:54:34 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694735674; a=rsa-sha256; cv=none; b=usMfGjn/NSjgWCjH1dX98iNnVk249t3Q61TBxCs42/pczVJXTgZo4qiUfSDVSrNrCVGM7g 493Qfq8bkID1IJiFZqLhxcRIfgCL8//fCu4u6TGgK4P0y1zqfIZnHL+tKbniqIfOmogbSW vVUn9qRCSEokuynJlcx7ARTlI59+OETmr/5cyngggRFYr/VQFTWoSDFBkVHjFQ3rtthMPC X/rTtzjvZDBCRS28gqJJDMvzdHl1by7rAHfjFeciIhRtcuLWCJogR4zttf62CDi5nQHh6h IwhTVP9wBUztVuXsHCGtKBywhG9i31xrfvEv6NIORJKX2qZB/wZG3HmB1zC0VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694735674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=77OnAooHSH/5JbOtsN52iqliR5TVJEKMpt+Mh//pkXM=; b=RmAG29c1BmkhyXhH55FQziM+Lj2F4raZcIIZYz2a6HUZuJTvQ74BnHoz/OslsZMbIL0Kq+ x6Dy09StXojCk9AvnLCjZVwAIEOlehX+JaL5yI/OPiQbYzg5R2Xp60WuWmzvB0kSLHC+TY hW3NKMrTEpA2rRihx9b6+cPAYHhIZmDdUqXL50CC2xcFs/2jbt2/d/9R6wQpz7T5P7kWRX CSJi5+nQIKArGkeobgLdxvaLfLTw3do1FtqVDQyJDwj9cQjHfL0wDLo/vrPLz8ulGFLj2Q QMh1Bu8KrcLeaqC+vb1hIV9bxXR+IvI+IgxpngXsCXV15dsoo847sU7l56+x9Q== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RmvLf1Gv7z1GSY for ; Thu, 14 Sep 2023 23:54:34 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 38ENsYrD021804 for ; Thu, 14 Sep 2023 23:54:34 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 38ENsYmP021803 for bugs@FreeBSD.org; Thu, 14 Sep 2023 23:54:34 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 273807] tcpdump is not able to set honor the timezone of the PC as set in /etc/localtime Date: Thu, 14 Sep 2023 23:54:33 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 14.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: mike@sentex.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273807 Bug ID: 273807 Summary: tcpdump is not able to set honor the timezone of the PC as set in /etc/localtime Product: Base System Version: 14.0-STABLE Hardware: amd64 OS: Any Status: New Severity: Affects Many People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: mike@sentex.net Summary discussion here=20 https://lists.freebsd.org/archives/freebsd-stable/2023-September/001448.html AMD64 VM of FreeBSD 14 from Sept 1st. TCPDUMP (in the base and in the port= s) will not work properly when the timezone is set to something other than UTC= .=20 e.g. tcpdump -nei pflog0 will display log entries always in UTC, despite wh= at /etc/localtime is set to.=20 des@freebsd.org wrote in the email thread In stable/13, tcpdump reads /etc/localtime very early, and long before entering capability mode: 72111 tcpdump 0.007527 NAMI "/etc/localtime" 72111 tcpdump 0.007541 RET open 3 72111 tcpdump 0.007549 CALL read(0x3,0x1a9058bb78c0,0xd6b8) 72111 tcpdump 0.007627 RET read 2298/0x8fa 72111 tcpdump 0.007634 CALL close(0x3) 72111 tcpdump 0.007642 RET close 0 [...] 72111 tcpdump 0.024369 CALL cap_enter 72111 tcpdump 0.024381 RET cap_enter 0 In main and stable/14, it enters capability mode immediately before the first attempt to read /etc/localtime, which fails: 745 tcpdump 0.069967829 CALL cap_enter 745 tcpdump 0.070015646 RET cap_enter 0 745 tcpdump 0.070139522 CALL=20 fstatat(AT_FDCWD,0x1c377723d38e,0x1c3773430d00 ,0) 745 tcpdump 0.070196299 NAMI "/etc/localtime" 745 tcpdump 0.070240578 RET fstatat -1 errno 94 Not permitted in capability mode 745 tcpdump 0.070487574 CALL=20 fstatat(AT_FDCWD,0x1c377723d38e,0x1c3773430cd0,0) 745 tcpdump 0.070550458 NAMI "/etc/localtime" 745 tcpdump 0.070593003 RET fstatat -1 errno 94 Not permitted in capability mode The simplest workaround is to call tzset(3) before entering capability mode. --=20 You are receiving this mail because: You are the assignee for the bug.=