Skip to content

Commit

Permalink
tcpdump: Initialize tzcode early.
Browse files Browse the repository at this point in the history
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
Approved by:	re (kib)

(cherry picked from commit 7e0a7ef)
(cherry picked from commit 51d54ed)
  • Loading branch information
dag-erling committed Sep 19, 2023
1 parent 6dff5fb commit c1b6110
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contrib/tcpdump/tcpdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c1b6110

Please sign in to comment.