From patchwork Tue Sep 19 11:44:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3348 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7301:2697:b0:d7:3b0f:3938 with SMTP id ha23csp1550328dyb; Tue, 19 Sep 2023 04:45:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWoM7z90nKe8oYeVKosvbkGpmfgTf1rhBWxn1cY8pgLemJPmTypSci0+SUlxX+WYkwghvG X-Received: by 2002:a05:6830:4509:b0:6be:ed61:a4a8 with SMTP id i9-20020a056830450900b006beed61a4a8mr10027022otv.2.1695123933742; Tue, 19 Sep 2023 04:45:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695123933; cv=none; d=google.com; s=arc-20160816; b=I9NwZjTF69M0C+tF0vb2Wp6RIy5oBNA6xn82vE9iCaQjkarYfm+ZXx6o6BQeppBCp6 j3dgA+Fr49JqNHhVNx/k4yuyPc28DLgzcBhZxmqaF3H5jjQ+M2Wt0GKQQRUUeieoarK9 HbHq0rh8VxP+KVcra1G2BfXHK32/p/+QmVEhc/QYqLfHSBGYf3M6NyzgS5bUzDF+t2iP V6L9hZ9iCs/VTPc2pnq+qXUAEohoRiO6OrPM5PZoawn2z042/vE6k3HoETTUjY9J0vpg m3xCHjpP1VNB0w00xPPEhTU0Es/MiAQch8ZWHjTeuaUzGEAiAUZDro391rmlO2u/sUV1 Is5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to: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:cc:date:from:dkim-signature :dkim-signature:dkim-signature; bh=9lwUr4zJzU/CwmMXOGWHZ+ibMcbASCcuCUAc/pxo+Hg=; fh=smjZBu6iNkWiUqneddhXe9SViGbN07L/0qKvVAHuico=; b=Il1E1cDbK40ZUe1CLOXtlIGsTY8tPH6VplJ1qPDbVkoubeVn21JLgJFhbRrnQtVYRv aO5+eAxDKSpI1m/WPIQ0CNHxXWnruHSOd97ZQB7VEWsGIL9NwcncvTz7Bc80LB00CssA 9lbhoscDAXS/91yo8L5K2yqesw1L7AOwUe81SbsIuQapXI4FjaooflUh3Wdq0XE83s3v pWwlWrmCTX0FYfUMbK9C3aj5ASHDO3I0Mf8BMi4WLwUdB07ICPWJUeYQififu1LH0lEJ W6rVWzhh5pN2BVuQVgReyCEFTl5NR9bDD53NEAlEC1J2JnqnofZlUdN1pT7bvxMdAuHa xmqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Vr9tSYkQ; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Oenrwyls; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=Q3Fg8gh6; 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 f26-20020a65629a000000b0054405623a4asi9206790pgv.615.2023.09.19.04.45.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Sep 2023 04:45:33 -0700 (PDT) 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=Vr9tSYkQ; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Oenrwyls; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=Q3Fg8gh6; 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-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1qiZ9k-0002mN-SG; Tue, 19 Sep 2023 11:44:41 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qiZ9i-0002mG-LH for openvpn-devel@lists.sourceforge.net; Tue, 19 Sep 2023 11:44:39 +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:Date:From :Sender:To: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=JxnCQlxnLsGiIsAu+sdYHRz2x7ZLJrZw3r1qeGBSuOo=; b=Vr9tSYkQqYy/PNEBlB5YfVL7xM qvK0e+4G4RnRx00i7ojv9smRtfIMvEHE27SURr3CP8WHU8lvx+ejSWC1HMeo3g/abfR2Tb1wXOfg3 KWSGTTj93MDnQiBVFzHvdNGHOVq+eV44/lQNdwBXGEI/vya1SkumZgAxR1yXs7qK4MKU=; 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:Date:From:Sender:To: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=JxnCQlxnLsGiIsAu+sdYHRz2x7ZLJrZw3r1qeGBSuOo=; b=O enrwylsEXu3P4CmAGuGkKj3ma0q05ZQ7WxBocMOOPeJfW4XHet+4ZxUn82U9Mlnw+8mPPB7SblMhK MToEeprzX5GjHNhAawq5MEOuhP5Iv2xGqH4FkVSXk6wDDExcSDS26lPjCvF43kvEms3q7jfwNtO6Z 5+nwdFEAX8ASrk8M=; Received: from mail-wm1-f49.google.com ([209.85.128.49]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1qiZ9d-0006VQ-56 for openvpn-devel@lists.sourceforge.net; Tue, 19 Sep 2023 11:44:39 +0000 Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-401187f8071so37387815e9.0 for ; Tue, 19 Sep 2023 04:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1695123866; x=1695728666; 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:date:from:from:to:cc :subject:date:message-id:reply-to; bh=JxnCQlxnLsGiIsAu+sdYHRz2x7ZLJrZw3r1qeGBSuOo=; b=Q3Fg8gh6zwUKA4jIzAZcxZyFle0sMi3oLqxk57zsoNmNhejk//dLdHSpJaT1SFa2ZQ DZqB1PAqNFY1b7MsIj5N0TePc0Gz12+D9oCx7MQ+QnTNVaZQwdxQF2ifRa0IveL/z8kA lqzcZsRsexAMySkRThy+WOsWB3J3ngMpTezTNvwYh2ezOQQG9WvU6txD1qdl19HoD8dY 2LeixAjH4xpxZj5A29gDayniXJXlgHTl9WbzL/neLSNAuy1l/rRoQ3d6c5QrFjRr7WSG QMcZrvy2N3c5pbuczFS5+SVqidKUzoiAtjUuO/KU1zJ7jmNf2Oh+qMqvxUoXj/j3uhlt DaDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695123866; x=1695728666; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JxnCQlxnLsGiIsAu+sdYHRz2x7ZLJrZw3r1qeGBSuOo=; b=LHPOLDrDuJWSIeFeQ+BQA46BzlcilM6KwkDF/OKyZMGdBqGvXy9gunkoka/lsmBNAD rC7v1eD/MRg0AZyql+rD/11TnXWUn+aR3ELMszFe916kDIlWBpBKtcqlb6SwqC704bu8 /4sJ2U58MKito841w8Ix28R6syBpmGfc5MI1954IngwR9O5XNIclx8A/KKnsxfE0bbxL ohpvYrd1QtD2XGhGnXtMI0UBwr3Yvye7HsmG1lSpxRcqcsQdZiUSvARMVh+G8J5PF0LS oXCowUhgnuTed6vOkskcy6UD6LBHUZm4zE9+y1wxp7T0c2vvJMgFkyCpQbpw/UQt6EP0 FQMw== X-Gm-Message-State: AOJu0YygxvH7B8yNCRE1AG0p65t7Djg4hxrtyoNBWYq2ADXU4gr2EjFh xpywSxkdJ0KBbeuiSby2VnuDQx3kG5gaa1kwuSU= X-Received: by 2002:a05:600c:15c7:b0:402:e68f:8a4f with SMTP id v7-20020a05600c15c700b00402e68f8a4fmr1894082wmf.0.1695123866514; Tue, 19 Sep 2023 04:44:26 -0700 (PDT) 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 v26-20020a1cf71a000000b003fe1630a8f0sm17982598wmh.24.2023.09.19.04.44.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 04:44:26 -0700 (PDT) From: "flichtenheld (Code Review)" X-Google-Original-From: "flichtenheld (Code Review)" X-Gerrit-PatchSet: 1 Date: Tue, 19 Sep 2023 11:44:25 +0000 Cc: openvpn-devel Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I4e16767ee221e1aefdd18d13b3411c27d8dd844a X-Gerrit-Change-Number: 342 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 00a11a7b4e001933b06e4648780bcdf416a68b62 References: Message-ID: MIME-Version: 1.0 User-Agent: Gerrit/3.8.1 X-Spam-Score: 1.0 (+) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.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: flichtenheld has uploaded this change for review. ( http://gerrit.openvpn.net/c/openvpn/+/342?usp=email ) Change subject: CMake: various small non-functional improvements Content analysis details: (1.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 MISSING_HEADERS Missing To: header 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.49 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.49 listed in wl.mailspike.net] 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 X-Headers-End: 1qiZ9d-0006VQ-56 Subject: [Openvpn-devel] [S] Change in openvpn[master]: CMake: various small non-functional improvements 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: frank@lichtenheld.com, openvpn-devel@lists.sourceforge.net Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1777466273595866353?= X-GMAIL-MSGID: =?utf-8?q?1777466273595866353?= flichtenheld has uploaded this change for review. ( http://gerrit.openvpn.net/c/openvpn/+/342?usp=email ) Change subject: CMake: various small non-functional improvements ...................................................................... CMake: various small non-functional improvements These are based on review comments for the 2.6 backport. But since they apply to the original master implementation as well, I address them in this separate patch. - Add documentation to contrib/cmake/*.py - Fix grammar in README.cmake.md - Update a TODO in CMakeLists.txt to better reflect the status quo - Fix indentation in unit_tests' Makefile.am Change-Id: I4e16767ee221e1aefdd18d13b3411c27d8dd844a Signed-off-by: Frank Lichtenheld --- M CMakeLists.txt M README.cmake.md M contrib/cmake/git-version.py M contrib/cmake/parse-version.m4.py M tests/unit_tests/openvpn/Makefile.am 5 files changed, 17 insertions(+), 3 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/42/342/1 diff --git a/CMakeLists.txt b/CMakeLists.txt index 7dae665..da5f883 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -291,7 +291,7 @@ configure_file(config.h.cmake.in config.h) configure_file(include/openvpn-plugin.h.in openvpn-plugin.h) -# TODO remove later when msvc-config.h is removed and we can always include config.h +# TODO we should remove the need for this, and always include config.h add_definitions(-DHAVE_CONFIG_H) include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/README.cmake.md b/README.cmake.md index 599d8dc..d181b64 100644 --- a/README.cmake.md +++ b/README.cmake.md @@ -24,7 +24,7 @@ ----------- The following tools are expected to be present on the system, you -can them install with a package manager of your choice (e.g. +can install them with a package manager of your choice (e.g. chocolatey, winget) or manually: * CMake diff --git a/contrib/cmake/git-version.py b/contrib/cmake/git-version.py index c2b4452..4f78ac4 100644 --- a/contrib/cmake/git-version.py +++ b/contrib/cmake/git-version.py @@ -22,6 +22,14 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # +# Usage: ./git-version.py [directory] +# Find a good textual representation of the git commit currently checked out. +# Make that representation available as CONFIGURE_GIT_REVISION in +# /config-version.h. +# It will prefer a tag name if it is checked out exactly, otherwise will use +# the branch name. 'none' if no branch is checked out (detached HEAD). +# This is used to enhance the output of openvpn --version with Git information. + import os import sys import subprocess diff --git a/contrib/cmake/parse-version.m4.py b/contrib/cmake/parse-version.m4.py index d5ff2bd..3dfb31f 100644 --- a/contrib/cmake/parse-version.m4.py +++ b/contrib/cmake/parse-version.m4.py @@ -22,6 +22,12 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # +# Usage: ./parse-version.m4.py m4file [directory] +# Read , extract all lines looking like M4 define(), and translate +# them into CMake style set(). Those are then written out to file +# /version.cmake. +# Intended to be used on top-level version.m4 file. + import os import re import sys diff --git a/tests/unit_tests/openvpn/Makefile.am b/tests/unit_tests/openvpn/Makefile.am index 6b56f84..ef45b11 100644 --- a/tests/unit_tests/openvpn/Makefile.am +++ b/tests/unit_tests/openvpn/Makefile.am @@ -110,7 +110,7 @@ -Wl,--wrap=parse_line \ -Wl,--wrap=rand_bytes tls_crypt_testdriver_SOURCES = test_tls_crypt.c mock_msg.c mock_msg.h \ - mock_win32_execve.c \ + mock_win32_execve.c \ $(top_srcdir)/src/openvpn/argv.c \ $(top_srcdir)/src/openvpn/base64.c \ $(top_srcdir)/src/openvpn/buffer.c \