From: "cron2 (Code Review)" Date: Sun, 3 Nov 2024 20:19:07 +0000 References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <0c672d80dbb4ba15fff71ff55d3afeafe7237bec-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="rOFlnlkBL7I="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: send uname() release as IV_PLAT_VER= on non-windows versions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --rOFlnlkBL7I= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/793?usp=3Demail to review the following change. Change subject: send uname() release as IV_PLAT_VER=3D on non-windows versi= ons ...................................................................... send uname() release as IV_PLAT_VER=3D on non-windows versions This is highly system specific, as the content of the uname() structure elements is not specified very well - uname(3) says: release Release level of the operating system which translates to "IV_PLAT_VER=3D13.3-RELEASE-p6" (FreeBSD) or "IV_PLAT_VER=3D22.6.0" (macOS) - the latter being the "Mach Kernel version", not what Apple calls the OS. It's still useful if a server operator needs to keep track of client versions (and the GUI does not set the corresponding environment variable, which neither Tunnelblick nor NM do). Change-Id: Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169 Signed-off-by: Gert Doering --- M src/openvpn/ssl.c M src/openvpn/syshead.h 2 files changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/93/793/1 diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 8040e7b..8632832 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -2010,6 +2010,10 @@ buf_printf(&out, "IV_SSL=3D%s\n", get_ssl_library_version() ); #if defined(_WIN32) buf_printf(&out, "IV_PLAT_VER=3D%s\n", win32_version_string(&g= c, false)); +#else + struct utsname u; + uname(&u); + buf_printf(&out, "IV_PLAT_VER=3D%s\n", u.release); #endif } diff --git a/src/openvpn/syshead.h b/src/openvpn/syshead.h index 83a48fc..33a90c1 100644 --- a/src/openvpn/syshead.h +++ b/src/openvpn/syshead.h @@ -331,6 +331,10 @@ #include #endif +#ifndef _WIN32 +#include +#endif + /* * Pedantic mode is meant to accomplish lint-style program checking, * not to build a working executable. -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/793?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169 Gerrit-Change-Number: 793 Gerrit-PatchSet: 1 Gerrit-Owner: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-MessageType: newchange --rOFlnlkBL7I= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

cron2 would like plaisthos and flichtenheld to review t= his change.

Vi= ew Change

send uname() release as IV_PLAT_VER=3D on non-windows version=
s

This is highly system specific, as the content of the uname()
s= tructure elements is not specified very well - uname(3) says:

= release Release level of the operating system

which translates= to "IV_PLAT_VER=3D13.3-RELEASE-p6" (FreeBSD) or
"IV_PLAT= _VER=3D22.6.0" (macOS) - the latter being the "Mach Kernel
ver= sion", not what Apple calls the OS.

It's still useful if a = server operator needs to keep track of
client versions (and the GUI does= not set the corresponding
environment variable, which neither Tunnelbli= ck nor NM do).

Change-Id: Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169<= br>Signed-off-by: Gert Doering <gert@...1296...>
---
M src/open= vpn/ssl.c
M src/openvpn/syshead.h
2 files changed, 8 insertions(+), 0= deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn ref=
s/changes/93/793/1
diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl=
.c
index 8040e7b..8632832 100644
--- a/src/= openvpn/ssl.c
+++ b/src/openvpn/ssl.c
@@ -2= 010,6 +2010,10 @@
buf_printf(&out, "I= V_SSL=3D%s\n", get_ssl_library_version() );
#if defin= ed(_WIN32)
buf_printf(&out, "IV_PLAT_= VER=3D%s\n", win32_version_string(&gc, false));
+#else
+ struct utsname u;
+ uname(&u);
+ buf_printf(&out, "IV_PLAT_VE= R=3D%s\n", u.release);
#endif
= }

diff --git a/src/openvpn/syshead.h b/= src/openvpn/syshead.h
index 83a48fc..33a90c1 100644<= br>--- a/src/openvpn/syshead.h
+++ b/src/openvpn/sysh= ead.h
@@ -331,6 +331,10 @@
#include <sy= s/mman.h>
#endif

+#ifndef _WIN32
+#include <sys/utsname.h>
+#endif
+
/*
* Pedant= ic mode is meant to accomplish lint-style program checking,
* not to build a working executable.

To view, visit change 793. To unsubscribe, or for help writing mail filters, vi= sit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id2b0c5a517f02e5c219fea2ae3e= f2bdef7690169
Gerrit-Change-Number: 793
Gerrit-PatchSet: 1
Gerrit-Owner: cron2 <gert@...1296...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newchange
--rOFlnlkBL7I=--