From patchwork Mon Nov 20 10:51:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "its_Giaan (Code Review)" X-Patchwork-Id: 3453 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:50e4:b0:f2:62eb:61c1 with SMTP id r4csp2181081dyd; Mon, 20 Nov 2023 02:52:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IHcEZlJBmwH3fDXHkWWo1gj0VaPjxCySIj5sohXU4oW4WhzkMOV2BwuIt5cpPCPj/kkfi0t X-Received: by 2002:a9d:77c2:0:b0:6d3:3332:fbfb with SMTP id w2-20020a9d77c2000000b006d33332fbfbmr7217042otl.0.1700477542869; Mon, 20 Nov 2023 02:52:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700477542; cv=none; d=google.com; s=arc-20160816; b=BZQIDlnL8APJRPPf096Vwi7/ITmRW4gyR5fBKoNlyeoT5zLo7TjUbgWJgJMzJgnUyl pCdq+dMQD8vqBKe8kMzhjNfqGVzod2yHMUgcxSi6bK7k4b5RKw8hdquOZNMUbC80HOfo KN1M4zqCfAJnh54kchDBWcy4/o2IlNCg9dL4zBU1Q2d/03QcsGRv4np24cftWV1TDGKz CJsqW9nAnjdyrWVnYZ8l4rEHwBvqATmcFCfg9sKkD/Sr3+5pSVX7ljuwCI/kFemQJH1G 7NA87s1IPUzq0VZvIHcMptn7heL44cgVL9DBOwI2qO8QvygBzVIEwmnY0A8kVyBdK7Y6 np3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=jixmyLLryaLkaGf541MB8VUZ/xgq7sE0Q4b9qqn81HY=; fh=lm0MLPW7DntlrDqRECIiC9JlE1uPxhepE0URYHIf+eE=; b=DWK57BzzvKndGiEcxuj/9WaSOXob9ZDC6Kyp+Y/++kD7aHM0vvSZ9H8cDbpVaB7P1B VjWwAHQVzHvJfRFTDyudAdJbAcs7+xOyarjw0QDfyNhks7esx+ZbHHLCgwrDQz3mo0QF oV3goE2OhDWI3za7DtpPbBFGQcLJsl+YHsDhkRQxsY8EtrpADEBvQQEdKBqMG69E/m3X S8k/EQ9xuCdBfrnXBKODq7SPI1fWWGphbhLOhze38GjDQUqcB3b3a6Ea+7SgXHs3LVx7 RHoTEedZOQ0YbtS4j85y5CH/VyEjHhXesZzgUnBf0yHJCff0ADCXjh1bAJpbo1xhmXm9 xOYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=lkzQKrpb; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="W/gpAEIt"; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=doU5zr9O; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id bm2-20020a656e82000000b005acf0458523si7944477pgb.612.2023.11.20.02.52.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2023 02:52:22 -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=lkzQKrpb; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="W/gpAEIt"; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=doU5zr9O; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1r51sM-0003RF-Qz; Mon, 20 Nov 2023 10:51:33 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1r51sL-0003R9-EY for openvpn-devel@lists.sourceforge.net; Mon, 20 Nov 2023 10:51:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=O36jUCuwbqI9iFEVFzKbKQKnbGCeSSvP5vWPM1kAemA=; b=lkzQKrpbI8/ESHvxKvJ610tEsh lXHQTTapxlUKopDGwz9nhkkfNJXHvIt665PhL1Sr1921z0bFE5wNVYbgnT7c0iG01QR1yXJaIwBSA tnIqFJ3LKHZ9ByUb7360Y1JB5gFxuM1Fb5+DWEasOtuyjd5x/I989Yh8bElByDbAf2O8=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=O36jUCuwbqI9iFEVFzKbKQKnbGCeSSvP5vWPM1kAemA=; b=W /gpAEItrAJUPPnqJPKO56yndy4MLO5pE60Qk9xTDpNY92mp1JjOzA6ltVpCZbr6WCuKjRC1qW5Urz 5LlriYXC+AnArIZk198FYUamPbd2WFrwK9ShwcruwlESHkzsxwIXZMQufsGowlSqGmbxutRHPJo8j ++vCHfzGqSdzpBac=; Received: from mail-lj1-f172.google.com ([209.85.208.172]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1r51sH-00Aw9E-EZ for openvpn-devel@lists.sourceforge.net; Mon, 20 Nov 2023 10:51:32 +0000 Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2c5056059e0so57247901fa.3 for ; Mon, 20 Nov 2023 02:51:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1700477482; x=1701082282; darn=lists.sourceforge.net; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=O36jUCuwbqI9iFEVFzKbKQKnbGCeSSvP5vWPM1kAemA=; b=doU5zr9OcL10CHumXKfM1dT/8QG1v9BPkbXvkDKEaS6Sr3nEZdZymInGdJy5GoRxcn n5IuRy1agS6aqYrhHL4iwWFI3ahBMp6tuAZWKqbuHCxFBPPGJHJiSJWq9ysOojmiP5Xr 3MPb/BOPs9AyqShYuEQNbaZP7nnyMrbu4zcB1xtJO/iPLRNAzznyPrxofyX5PCzVr897 4U2DuKU9lkJQ25dMmmF4Q182UFlGbYAE6kR8T9NgnzeVv6IYa6om1XMjFlie4Tqn5dvS OzF8tWmoMnA7+geBuC9LpwcWjuyva9Rd/zdxuA0nFI0zHffRmBRVQ84IDDjtWWvDJ8zk VEiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700477482; x=1701082282; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=O36jUCuwbqI9iFEVFzKbKQKnbGCeSSvP5vWPM1kAemA=; b=NS9QyEGA+l/AU8BQv2B+UfI35jmKMSqMRfN/wenSqi+h008UbQjHZ7bBxEHkfFNn72 Tw8ttzDqMCEYqyHMePT6PCB7kFwS9L+9TM3B5+IzjearRkkq7XcYG7nudvozMnr3MbAB dzS7YW9AVUM5+/Lu/EYWjWwCyFIOsBcl2ljilVu5JLi7J8VFLZdEsW3SLVc2dNPkQvim hpKrV+LFHPwC4VpP4jur1HnNyNmI2CerBpfIOlumSFdr3JZDJMJ9rpUq0uqgvDD2Wju3 BkBkQ9/oUfgN2VJQCB8cMftxGQ2bjv2fpBsQrDc32elBuG/5me/Pcf6xdM3pGSKEYIhO lQKQ== X-Gm-Message-State: AOJu0Ywjuh5fHgCRH5G1KE38gbZ5IMV7oaVH93aaboNyiFvTx+Y4dZat VfngI9Yv7y8B4OzMRlSUoxwXHiGQmdNlwvaFHHA= X-Received: by 2002:a2e:8e32:0:b0:2c8:7665:9ede with SMTP id r18-20020a2e8e32000000b002c876659edemr3525353ljk.19.1700477482420; Mon, 20 Nov 2023 02:51:22 -0800 (PST) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id l4-20020a05600c1d0400b004067e905f44sm13084937wms.9.2023.11.20.02.51.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 02:51:21 -0800 (PST) From: "plaisthos (Code Review)" X-Google-Original-From: "plaisthos (Code Review)" X-Gerrit-PatchSet: 1 Date: Mon, 20 Nov 2023 10:51:21 +0000 To: flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I9c85ccab6d51064ebff2c391740ba8c2d044ed1a X-Gerrit-Change-Number: 445 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 0b57cf049a3c4840d7104a95007bd393c08ae177 References: Message-ID: MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -0.2 (/) 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: Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.172 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.172 listed in list.dnswl.org] 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1r51sH-00Aw9E-EZ Subject: [Openvpn-devel] [M] Change in openvpn[master]: 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: , Reply-To: arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1783079939787301270?= X-GMAIL-MSGID: =?utf-8?q?1783079939787301270?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/445?usp=email to review the following change. Change subject: Remove compat versionhelpers.h and remove cmake/configure check for it ...................................................................... Remove compat versionhelpers.h and remove cmake/configure check for it The cmake file defined that file to be never present in contrast to the old msvc-config.h that always had it present. Also interactive.c includes versionhelpers.h without the check, so we always assume it to be present anyway. Remove also the comapt implementation taken from mingw Change-Id: I9c85ccab6d51064ebff2c391740ba8c2d044ed1a --- M CMakeLists.txt M config.h.cmake.in M configure.ac M src/compat/Makefile.am D src/compat/compat-versionhelpers.h M src/openvpn/win32.c M src/openvpnserv/interactive.c 7 files changed, 1 insertion(+), 131 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/45/445/1 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"