From: "cron2 (Code Review)" Date: Wed, 6 Nov 2024 07:05:07 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., a@...2181... Message-ID: <08472c8aecf3d724ba6479d66a3c03823587746d-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="QVe40IgzecU="; charset=UTF-8 Subject: [Openvpn-devel] [S] 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 --QVe40IgzecU= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello flichtenheld, ordex, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/793?usp=3Demail to look at the new patch set (#5). The following approvals got outdated and were removed: Code-Review+2 by ordex 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). v2: manpage amendments v3: whitespace v4: reword manpage Github: OpenVPN/openvpn#637 Change-Id: Id2b0c5a517f02e5c219fea2ae3ef2bdef7690169 Signed-off-by: Gert Doering Acked-by: Antonio Quartulli Message-Id: <20241104085808.17039-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg29= 699.html Signed-off-by: Gert Doering --- M doc/man-sections/client-options.rst M src/openvpn/ssl.c M src/openvpn/syshead.h 3 files changed, 12 insertions(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/93/793/5 diff --git a/doc/man-sections/client-options.rst b/doc/man-sections/client-= options.rst index a06948e..5ca85e0 100644 --- a/doc/man-sections/client-options.rst +++ b/doc/man-sections/client-options.rst @@ -430,7 +430,10 @@ The version of the operating system, e.g. 6.1 for Windows 7. This may be set by the client UI/GUI using ``--setenv``. On Windows systems it is automatically determined by openvpn - itself. + itself. On other platforms OpenVPN will default to sending + the information returned by the `uname()` system call in + the `release` field, which is usually the currently running + kernel version. This is highly system specific, though. :code:`UV_=3D` Client environment variables whose names start with diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 8040e7b..93e31f1 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: 5 Gerrit-Owner: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: ordex Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --QVe40IgzecU= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #5 to this change.

View Change

The following approvals got outdated and were removed: Code-Review+2 by ordex

send uname() release as IV_PLAT_VER=3D on non-window=
s versions

This is highly system specific, as the content of the una= me()
structure elements is not specified very well - uname(3) says:
<= br> release Release level of the operating system

which t= ranslates to "IV_PLAT_VER=3D13.3-RELEASE-p6" (FreeBSD) or
&quo= t;IV_PLAT_VER=3D22.6.0" (macOS) - the latter being the "Mach Kern= el
version", not what Apple calls the OS.

It's still use= ful 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).

v2: manpage amendments
v3: whitespace
= v4: reword manpage

Github: OpenVPN/openvpn#637

Change-Id: Id2= b0c5a517f02e5c219fea2ae3ef2bdef7690169
Signed-off-by: Gert Doering <g= ert@...1296...>
Acked-by: Antonio Quartulli <a@...2181...>
M= essage-Id: <20241104085808.17039-1-gert@...1296...>
URL: https://w= ww.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg29699.html
Si= gned-off-by: Gert Doering <gert@...1296...>
---
M doc/man-secti= ons/client-options.rst
M src/openvpn/ssl.c
M src/openvpn/syshead.h3 files changed, 12 insertions(+), 1 deletion(-)

git pull ssh:=
//gerrit.openvpn.net:29418/openvpn refs/changes/93/793/5
diff --git=
 a/doc/man-sections/client-options.rst b/doc/man-sections/client-options.rs=
t
index a06948e..5ca85e0 100644
--- a/doc/m= an-sections/client-options.rst
+++ b/doc/man-sections/clien= t-options.rst
@@ -430,7 +430,10 @@
= The version of the operating system, e.g. 6.1 for Windows 7.
This may be set by the client UI/GUI using ``--setenv``.=
On Windows systems it is automatically determined by ope= nvpn
- itself.
+ itself. On o= ther platforms OpenVPN will default to sending
+ the information returned by the `uname()= ` system call in
+ = the `release` field, which is usually the currently running
= + kernel version. This = is highly system specific, though.

:co= de:`UV_<name>=3D<value>`
Client enviro= nment variables whose names start with
diff --git a/src/ope= nvpn/ssl.c b/src/openvpn/ssl.c
index 8040e7b..93e31f1 10064= 4
--- 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_pri= ntf(&out, "IV_PLAT_VER=3D%s\n", win32_version_string(&gc,= false));
+#else
+ struct utsna= me u;
+ un= ame(&u);
+ = buf_printf(&out, "IV_PLAT_VER=3D%s\n", u.release);
#endif
}

<= span>diff --git a/src/openvpn/syshead.h b/src/openvpn/syshead.h

<= span>index 83a48fc..33a90c1 100644

--- a/src/openvpn/syshea= d.h
+++ b/src/openvpn/syshead.h
@@ -331,6 += 331,10 @@
#include <sys/mman.h>
#en= dif

+#ifndef _WIN32
+#in= clude <sys/utsname.h>
+#endif
+
/*
* Pedantic mode is meant to accomplish li= nt-style program checking,
* not to build a working execu= table.

To view, visit change 793. To unsubsc= ribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id2b0c5a517f02e5c219fea2ae3e= f2bdef7690169
Gerrit-Change-Number: 793
Gerrit-PatchSet: 5
Gerrit-Owner: cron2 <gert@...1296...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: ordex <a@...2181...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--QVe40IgzecU=--