From patchwork Tue Nov 28 10:39:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 3484 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:693c:368c:b0:fb:b703:d903 with SMTP id sp12csp2466524dyc; Tue, 28 Nov 2023 02:40:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IEWjOJgEyqvtT52YpvIaIvzwXDgWMqOwdWrC9Mli9nrK1keJDohGpVWZlmxRcKlLNDOb0Wl X-Received: by 2002:a17:90a:7408:b0:285:6f2b:4e82 with SMTP id a8-20020a17090a740800b002856f2b4e82mr14610480pjg.1.1701168049704; Tue, 28 Nov 2023 02:40:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701168049; cv=none; d=google.com; s=arc-20160816; b=gb0gWBBiqkN73+oV9DdDnQNTOGWvY0pAcV+AwTLQ7LyhA5UYIzI71zbnnPvMA8tIBd Kb0uZZbXr7ry1cSEc86sI5NvlHMkReDq0YRrO/rmnftKtNCu3VB2s9seT7y2aYXZEypz 4i1i1p0+vlh+oDDhP+fTJm6s36OfhMcyM5tFohHHlviKBzTguNM7Ir9P9B5ls7YPbtjr 6v+4KSbJbxXLvxlR5Ecmspl3QnAXtJgBh/0NvdBpSQ4a9wJIouxUmFBjIWBGCJoxFtJK pBhNw3wydQricIjX618UNKRNAe7eW9wuZIOsGhgKMiGRhcetAZa6bmbAGYrRLkLzmd4H YciQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=7yc8tbWvgjxpjYMwwh6DaLOClqsDrpCmfupDFEnGaVA=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=plMxORxWi8QUd01Yjb+j/mkC5n1/PR5fjBUnLd0aOLhZpEo70zKWrVoEW8a3u5mAv0 ZgxfwAtmu/77rLK0kLe2NvqNUl0l+DA3dg7ZczlFiwC741XEY8DvgyzcIxZ7AGNIE0Tk NyQG13IYeSov5oVOmT8h6FhF6Fr04OnutPwsKgXF9zeVxgToG5tQSzYSxw+pmOct9oig TWmGIy/ZJaBbm/f6uIiF7mKWOptK3rJDAuIiJW1DmJHrljZlpFJk48pM7NPHZyxdKc8A Ed38FQS8BsrFRd3LIAef3ka3CujMz1nAKuWJQ0ZdU/HcipgwMDYH2rkqPH07ddGgc0AO 7DCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=NWPvW6iw; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=TMsPMe9Y; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=Asa7KSL8; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id p6-20020a17090ab90600b0028598045121si9064097pjr.9.2023.11.28.02.40.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Nov 2023 02:40:49 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=NWPvW6iw; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=TMsPMe9Y; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=Asa7KSL8; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1r7vVa-0002dL-MH; Tue, 28 Nov 2023 10:40:03 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1r7vVZ-0002cx-0D for openvpn-devel@lists.sourceforge.net; Tue, 28 Nov 2023 10:40:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=E5HVPTueTEj4AqTHI2pmLMI1Uc7HEoyEWT1b71HrXyQ=; b=NWPvW6iwZdPZt5+5D+KcZIXgLV 3kRlfR57plRbS4D3UkpVOLRa+RpiNmnvQFb+Tk+Vy8yvZxxB2IzxkMRkcBXUHVd+oa8HpNK16N6QX LNhrh9EeSOz/4yBbQ2MJDavXddXyXlUM/EGgwVmuf5cWXFzuAKrzrCSX6iMlWrlZoWVU=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=E5HVPTueTEj4AqTHI2pmLMI1Uc7HEoyEWT1b71HrXyQ=; b=TMsPMe9Yg7TuYuOFZGYFfT2EoJ Y4cugTAvnfBIlcv/tgJw8Oo1Hcs0FFoeb10VX9MG1Jags/fuXkLNdzh0p1nFMEN7fuxGaZ8kRX8Yc l5drrbwutwEsifnuTkwGFQp2sNuhhuorvtoYQX+uQB4CHZ5fdCKfVSMK4wOHBQWbUZis=; Received: from mout-p-102.mailbox.org ([80.241.56.152]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1r7vVY-000584-7S for openvpn-devel@lists.sourceforge.net; Tue, 28 Nov 2023 10:40:01 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4Sff934n1Rz9t7S; Tue, 28 Nov 2023 11:39:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1701167991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E5HVPTueTEj4AqTHI2pmLMI1Uc7HEoyEWT1b71HrXyQ=; b=Asa7KSL8W24i9sPkCj/8HjKPUsjRO2mgWAUmCkUGt9obG3E++YZYfg3ypYpR/yQgIRJrfx /0dvdesvolaAiX1swO5imIQ8k2bmpMLO0Dknp8tTjufTgSiT3F0AvyfglBAAoCSy4VPZ08 /lgqIRm0Gsvuw3+FD2RSkGgkQJzIz2s4gOQjZNTTSHhIwS2aAYFbilEsm4Qk0iT2M5vEaa VV739o3G/WnJIU6km0reR7KLKYNxJ3sJBzeNy4oxrRa6sdU+2zt9NJcJyzFEHco4mfNcDn 9c/82CJptE34u+9MCODcMR1f3t32CsIF5SfQbSgSp/Ri9NaycOWUhD8dqAByUg== From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Tue, 28 Nov 2023 11:39:50 +0100 Message-Id: <20231128103950.62407-1-frank@lichtenheld.com> In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 4Sff934n1Rz9t7S X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Arne Schwabe The cmake file defined that file to be never present in contrast to the old msvc-config.h that always had it present. Remove also the compat implementation taken from mingw. All our current build envi [...] Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.152 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1r7vVY-000584-7S Subject: [Openvpn-devel] [PATCH v2] Remove compat versionhelpers.h and remove cmake/configure check for it X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1783803988962231657?= X-GMAIL-MSGID: =?utf-8?q?1783803988962231657?= From: Arne Schwabe The cmake file defined that file to be never present in contrast to the old msvc-config.h that always had it present. Remove also the compat implementation taken from mingw. All our current build environments already have that header in place. Change-Id: I9c85ccab6d51064ebff2c391740ba8c2d044ed1a Acked-by: Frank Lichtenheld Signed-off-by: Arne Schwabe --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/445 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld I fixed two typos in commit message relative to Gerrit submission. diff --git a/CMakeLists.txt b/CMakeLists.txt index d21c9bd..fa6d623 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -308,7 +308,6 @@ src/compat/compat-dirname.c src/compat/compat-gettimeofday.c src/compat/compat-strsep.c - src/compat/compat-versionhelpers.h src/openvpn/argv.c src/openvpn/argv.h src/openvpn/base64.c diff --git a/config.h.cmake.in b/config.h.cmake.in index 19b79bc..8edaff4 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -374,9 +374,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_VALGRIND_MEMCHECK_H -/* Define to 1 if you have the header file. */ -#undef HAVE_VERSIONHELPERS_H - /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK diff --git a/configure.ac b/configure.ac index 84eaad6..94c6654 100644 --- a/configure.ac +++ b/configure.ac @@ -455,7 +455,6 @@ unistd.h dlfcn.h \ netinet/in.h \ netinet/tcp.h arpa/inet.h netdb.h \ - versionhelpers.h \ ]) AC_CHECK_HEADERS([ \ sys/time.h sys/ioctl.h sys/stat.h \ diff --git a/src/compat/Makefile.am b/src/compat/Makefile.am index f5de451..5298dd8 100644 --- a/src/compat/Makefile.am +++ b/src/compat/Makefile.am @@ -20,5 +20,4 @@ compat-basename.c \ compat-gettimeofday.c \ compat-daemon.c \ - compat-strsep.c \ - compat-versionhelpers.h + compat-strsep.c \ No newline at end of file diff --git a/src/compat/compat-versionhelpers.h b/src/compat/compat-versionhelpers.h deleted file mode 100644 index b071602..0000000 --- a/src/compat/compat-versionhelpers.h +++ /dev/null @@ -1,116 +0,0 @@ -/** - * This file is part of the mingw-w64 runtime package. - * No warranty is given; refer to the file DISCLAIMER within this package. - */ - -#ifndef _INC_VERSIONHELPERS -#define _INC_VERSIONHELPERS - -#include - -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && !defined(__WIDL__) - -#ifdef __cplusplus -#define VERSIONHELPERAPI inline bool -#else -#define VERSIONHELPERAPI FORCEINLINE BOOL -#endif - -#define _WIN32_WINNT_WINBLUE 0x0603 - -#ifndef _WIN32_WINNT_WINTHRESHOLD -#define _WIN32_WINNT_WINTHRESHOLD 0x0A00 /* Windows 10 */ -#endif - -VERSIONHELPERAPI -IsWindowsVersionOrGreater(WORD major, WORD minor, WORD servpack) -{ - OSVERSIONINFOEXW vi = {sizeof(vi), major, minor, 0, 0, {0}, servpack}; - return VerifyVersionInfoW(&vi, VER_MAJORVERSION|VER_MINORVERSION|VER_SERVICEPACKMAJOR, - VerSetConditionMask(VerSetConditionMask(VerSetConditionMask(0, - VER_MAJORVERSION, VER_GREATER_EQUAL), - VER_MINORVERSION, VER_GREATER_EQUAL), - VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL)); -} - -VERSIONHELPERAPI -IsWindowsXPOrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 0); -} - -VERSIONHELPERAPI -IsWindowsXPSP1OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 1); -} - -VERSIONHELPERAPI -IsWindowsXPSP2OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 2); -} - -VERSIONHELPERAPI -IsWindowsXPSP3OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 3); -} - -VERSIONHELPERAPI -IsWindowsVistaOrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 0); -} - -VERSIONHELPERAPI -IsWindowsVistaSP1OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 1); -} - -VERSIONHELPERAPI -IsWindowsVistaSP2OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 2); -} - -VERSIONHELPERAPI -IsWindows7OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 0); -} - -VERSIONHELPERAPI -IsWindows7SP1OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 1); -} - -VERSIONHELPERAPI -IsWindows8OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN8), LOBYTE(_WIN32_WINNT_WIN8), 0); -} - -VERSIONHELPERAPI -IsWindows8Point1OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINBLUE), LOBYTE(_WIN32_WINNT_WINBLUE), 0); -} - -VERSIONHELPERAPI -IsWindows10OrGreater() -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINTHRESHOLD), LOBYTE(_WIN32_WINNT_WINTHRESHOLD), 0); -} - -VERSIONHELPERAPI -IsWindowsServer(void) -{ - OSVERSIONINFOEXW vi = {sizeof(vi), 0, 0, 0, 0, {0}, 0, 0, 0, VER_NT_WORKSTATION}; - return !VerifyVersionInfoW(&vi, VER_PRODUCT_TYPE, VerSetConditionMask(0, VER_PRODUCT_TYPE, VER_EQUAL)); -} - -#endif /* if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && !defined(__WIDL__) */ -#endif /* ifndef _INC_VERSIONHELPERS */ diff --git a/src/openvpn/win32.c b/src/openvpn/win32.c index 47eb1fc..e998d90 100644 --- a/src/openvpn/win32.c +++ b/src/openvpn/win32.c @@ -45,11 +45,7 @@ #include "memdbg.h" -#ifdef HAVE_VERSIONHELPERS_H #include -#else -#include "compat-versionhelpers.h" -#endif #include "block_dns.h" diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index a47db8a..32c8996 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -34,11 +34,7 @@ #include #include -#ifdef HAVE_VERSIONHELPERS_H #include -#else -#include "compat-versionhelpers.h" -#endif #include "openvpn-msg.h" #include "validate.h"