Hi,

On Mon, Feb 05, 2024 at 12:25:51PM +0100, Bo Berglund wrote:
> >  https://community.openvpn.net/openvpn/ticket/719
> >
> >which says that from 2.5.0 on, there should be POSIX timestamps.
> >
> >How old is your OpenVPN?
> 
> This is on the Ubuntu 20.04 LTS server:
> 
> Aug 21 2023:
> 
> $ openvpn --version
> OpenVPN 2.4.12 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] 
> [PKCS11]

Ah, yes.  So that's a bit of an antique :-)


> Well not quite so:
> 
> $ openvpn --show-gateway
> Mon Feb  5 12:15:15 2024 ROUTE_GATEWAY 192.168.119.1/255.255.255.0 IFACE=eth0
> HWADDR=a4:ae:12:7f:4d:c3
> 
> It looks like a kind of locale thing, thinking that it is a US location, but 
> it
> uses the CET time zone notwithstanding:

No, it's just old OpenVPN.  The ticket I linked to shows that I changed
the logging timestamp to ISO format "for 2.5.0".  Your 2.4.12 has a
release date younger than 2.5.0 (due to overlapping release trains), but
feature-wise, it's older.

We maintain multiple releases in parallel (like, 2.4.x and 2.5.x, or now
2.5.x and 2.6.x).  Features get added to "master" and show up in the next
.0 release (2.5.0, 2.6.0).  After that, only bugfixes (and sometimes minor
features) get added to .1, .2, .3 releases - "changing time stamps and
making logs look very different" was seen as breaking change, so even
if the code change is small, not suitable for integration in 2.4.9->2.4.10.

See also:
  https://community.openvpn.net/openvpn/wiki/SupportedVersions


IOW, yes, the old code was using the C function "ctime()", which will
print "something locale based".  The new code changes that to an ISO 8601
based format, locale independent

commit ff063b6f19e035da56fbf49c891e6376543b391d
Author: Gert Doering <g...@greenie.muc.de>
Date:   Sat Jun 20 19:23:03 2020 +0200

    Change timestamps in file-based logging to ISO 8601 time format.
...
--- a/src/openvpn/otime.c
+++ b/src/openvpn/otime.c
...
-    buf_printf(&out, "%s", ctime(&t));
-    buf_rmtail(&out, '\n');
+    struct tm *tm = localtime(&t);
+
+    buf_printf(&out, "%04d-%02d-%02d %02d:%02d:%02d",
+                tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
+                tm->tm_hour, tm->tm_min, tm->tm_sec);


gert
-- 
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             g...@greenie.muc.de

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users

Reply via email to