Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Sep 2023 21:36:51 GMT
From:      Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= <des@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 7e0a7ef95fac - main - tcpdump: Initialize tzcode early.
Message-ID:  <202309152136.38FLap9X038042@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=7e0a7ef95fac1183854cab662bd9afa4647422d6

commit 7e0a7ef95fac1183854cab662bd9afa4647422d6
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2023-09-15 21:36:41 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2023-09-15 21:36:41 +0000

    tcpdump: Initialize tzcode early.
    
    An explicit tzset() call is usually not needed as it happens implicitly
    the first time we call localtime() or mktime(), but in some cases
    (sandboxing, chroot) this may be too late.
    
    PR:             273807
    MFC after:      3 days
    Reviewed by:    jrm
    Differential Revision:  https://reviews.freebsd.org/D41880
---
 contrib/tcpdump/tcpdump.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/contrib/tcpdump/tcpdump.c b/contrib/tcpdump/tcpdump.c
index 52209fedb999..8cfcb04fc093 100644
--- a/contrib/tcpdump/tcpdump.c
+++ b/contrib/tcpdump/tcpdump.c
@@ -1564,6 +1564,8 @@ main(int argc, char **argv)
 	if (abort_on_misalignment(ebuf, sizeof(ebuf)) < 0)
 		error("%s", ebuf);
 
+	tzset();
+
 	while (
 	    (op = getopt_long(argc, argv, SHORTOPTS, longopts, NULL)) != -1)
 		switch (op) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202309152136.38FLap9X038042>