The comment above priv_localtime() says, the obtained localtime (from the 
privileged process) is cached for about one minute. However, since the 
according if statement compares the wrong variable, the caching doesn't 
happen. This bug is there since the very first file version (from 15+ 
years ago).

Regards
Holger


Index: usr.sbin/tcpdump/privsep.c
===================================================================
RCS file: /cvs/src/usr.sbin/tcpdump/privsep.c,v
retrieving revision 1.53
diff -u -p -u -r1.53 privsep.c
--- usr.sbin/tcpdump/privsep.c  18 Mar 2019 00:09:22 -0000      1.53
+++ usr.sbin/tcpdump/privsep.c  10 May 2019 13:17:42 -0000
@@ -727,7 +727,7 @@ priv_localtime(const time_t *t)
        static struct tm *gt = NULL;
        static char zone[PATH_MAX];
 
-       if (gt != NULL) {
+       if (t != NULL) {
                gt = gmtime(t);
                gt0.tm_sec = gt->tm_sec;
                gt0.tm_zone = gt->tm_zone;

Reply via email to