From patchwork Wed Jan 8 12:58:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 4039 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:1539:b0:5e7:b9eb:58e8 with SMTP id a25csp711099mar; Wed, 8 Jan 2025 04:59:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVSXdvxC1KuGeStYu0tnBI7kt3QViti8WGndhcAnfIF6UmaV9N95rrb/2jmzRr4Yw4sxTrNXN+a+G0=@openvpn.net X-Google-Smtp-Source: AGHT+IFTkgssN/NMCF+wq3Oh7DNbmxrAbx8mdsWETgnUMG1DhfXU7fX5XRpq0TQDJlHjbCpRT1C/ X-Received: by 2002:a05:6870:9c83:b0:29e:526a:eeef with SMTP id 586e51a60fabf-2aa0690ea57mr1005261fac.34.1736341155440; Wed, 08 Jan 2025 04:59:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736341155; cv=none; d=google.com; s=arc-20240605; b=WquJiEAs7loUn3JjJ2hWI5StcgC5VF44gu5xgvtjuw/PJzPjiv9NeUCLxpBKZ4icua tXKcAtMs7Mamo2FWHNlRjtU9DOxJyprl/iK0NbaTecSju1m/BJUWCoSqjDq97Iumj5zB fRP4aWyDhS7bFUA1njyQrFyyQF156IXgEXpZPmP8iyT+a47M+JhP8E3oEhQn+AoEOu56 mTrI9R3u6zuwjzTA5/P/t9/ckKJaO+UW5Wqk3WF0Uw/5LkeNqGBXVN3nEiVLBiQVXvQu jRlhU6LXsy0G5oetFmtB9N7NcQkZQeAOhQ1dDtCtWfBhmGfjmcv14la9coly9v72c1Fw votQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=4Lmq4781d002S7KJMib80p4ecxE+o/a0rajagRuUO+o=; fh=GFP4qDxgyJ2WEPo/oeLZg3Mj4NqvY1j2nTvTt7psNwg=; b=HCUXkDTaLy0faUddvsYMGi5Bx0FRByMxaCaaKlxVDiea24tN5EmlKunbl6Ji11KgGn F9XlevZQKomRD96Fxhv0R6thWrYCB4Miw8cptmnLU85aysvJfra85kYRe/PA8ck2rvVu SsCBmIf5vou1FjLY5Y2ez+345Viitl8bU0PkoeCZpqNej0UVk/FKxpGed4ezbSdB+BtA OLIRK9a9Onm3ZnPAmuWyK1UKm/FRyG1xT7pVBVSaQd/XcnbLDxJnF10XFNiW4AMT7zMI Rt0cTKV7GsSt/e9StwPuuxXgdl7BQa0Rz84G1SST0xU7+wIGkDcDgjf3D89/C39TmCKu 5NWw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=MEHW2+ZC; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=C91p9RDr; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=P75x0XFy; 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; dara=fail header.i=@openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 586e51a60fabf-2a7d7817a0esi25009142fac.191.2025.01.08.04.59.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jan 2025 04:59:15 -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=MEHW2+ZC; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=C91p9RDr; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=P75x0XFy; 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; dara=fail header.i=@openvpn.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 1tVVeM-0004Yg-KA; Wed, 08 Jan 2025 12:59:06 +0000 Received: from [172.30.29.66] (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 1tVVeJ-0004YL-V4 for openvpn-devel@lists.sourceforge.net; Wed, 08 Jan 2025 12:59:03 +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=0E8p8jDB/8lqcw0ORo9kBVQhVGPxTgpN6WLkJy/8acs=; b=MEHW2+ZC+57Pl+gtMzy3o9ZgBk W8FV6CPBeXp/o44SzEYrciQ0dPDF0CwIq1lP1aByxlQnyFAjQRGInPHbmYxcqaDKj6+JtiT6eq/pd m7SwhL8xOM7Y8eKLhaI3n6g4QXmo/CIut0M5FC+5t9vPkXIAnqDx6RTDzjZkn9zioKMg=; 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=0E8p8jDB/8lqcw0ORo9kBVQhVGPxTgpN6WLkJy/8acs=; b=C 91p9RDrfAscoCiIz8ZwY+2HiqfXWqZmRCk9U+NWJ9sMHI49fDP8Vib/P2f9gVcmZO2MkF4A8UZFCX lk6u2e7Kb3L3l0s1nfyqhHZaGzS/X2VoJZSdhU2KdHdcEs6TTm7f+AEFYgliS4sSz+hb0CAp73hqh fbeopw+yFwksAHBQ=; Received: from mail-wm1-f45.google.com ([209.85.128.45]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1tVVeI-00020Q-JM for openvpn-devel@lists.sourceforge.net; Wed, 08 Jan 2025 12:59:03 +0000 Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4361dc6322fso111822415e9.3 for ; Wed, 08 Jan 2025 04:59:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1736341131; x=1736945931; 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=0E8p8jDB/8lqcw0ORo9kBVQhVGPxTgpN6WLkJy/8acs=; b=P75x0XFyYuzp1zXl/4ADdnwEamhf0+6skK9kCfJIQhQavbLR85zbUIH5Ue7baOBAJF R/PkKBupjrYcgZWDaypnEeVgZEBCCIt8XSm343ZRi4NzUWDlIsPjG5rk1VAWfAqDMljB Utt6W+hK1RVD5pJSXfmuaMh9tjl4jblhfOQWoZS5AnqAHAZN6v7VsaQ8R9hnISmzSpc8 1Y2e+Z9WV0qXv6R8UPuiAuEtP2oErr6w208cYTfULjlgjKZiZP0KgpBBO0y4K3yB5XxB EEKpRVcKjzvHX53OD6rRkEV/EFqRIrnkRPbP27KLgawMuSQjM+zi/oRqAb1VWs8nkIKs jZSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736341131; x=1736945931; 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=0E8p8jDB/8lqcw0ORo9kBVQhVGPxTgpN6WLkJy/8acs=; b=kluBbSNhVr/HWfUYKYpmHRzJDENlo1EJiEDynPcriJqgRWdb0OjN4sd56HazHZIdgR WsfrIMxYoHobqN0Bx041o5c/J5xsmCPxc1OBPicAAzLOBCeOgMggwmq9tSyVMaCfbKtK pL+D1XBYhBOBR2Da0Yxtzs3//E2HAbmRRUpQudp1rEdhT8V4zHJk9qdwZSKTmloAPIGj 8XLzgzAhB0Q9wuZ8PKSDW/fFQ9yNjSNvrr92U6V21ZiZ7gd/CoZ/xjk8rgVlnRVNcMua MBc57fEvKSshUxrR0zQmj5hiVAMlDHZAuYqwkp+JgAB5COe8wP2oQGo37hZJLXPd6Uoj BWhw== X-Gm-Message-State: AOJu0YyJ+vuNvC1If3f7nRMeEUyVjtWX1xxflOvTyF7FvFLEFntVp5PR Ql75iMiJaX620eu4Cnps3OvH0V46gSkzBuvIAIli6TpulbiAs0o8Ug057k5h3Pkxn967FM4ZD/9 R X-Gm-Gg: ASbGncstaiMoaTgaIxDQ5TXcq92bdifNBjz/SzRUHjt0l1c1ufaLTmQMzayrzonu0FH 5lyJJHzJqmD49P/GI8vPYhDFCkQlGwxLmO0kwXjlkt9RLV7jA2rVFFULpglKUasgCmZh6equtMo iER4mcjT/NwxefJuG5NUSEcLfJpQkYd+UDGkhJhoZMGigbkPlCFMUF6D6MmEFVUolLmqJtPNBOY WhpUU+4lR1iBrIFs6B8D9tU6NWAaycJjoRlXGsGM4k+f4klgTt1FD2NsMlRU3+yJnAuw+shno8p mI+qo0e8kRHa5jfvBcUopPMKMu2FbdB51hmQAWzBC3z9+sT5 X-Received: by 2002:a5d:5f52:0:b0:385:fcfb:8d4f with SMTP id ffacd0b85a97d-38a872deb1amr2625253f8f.21.1736341130875; Wed, 08 Jan 2025 04:58:50 -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 ffacd0b85a97d-38a85f54c31sm1910510f8f.19.2025.01.08.04.58.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 04:58:50 -0800 (PST) From: "flichtenheld (Code Review)" X-Google-Original-From: "flichtenheld (Code Review)" X-Gerrit-PatchSet: 1 Date: Wed, 8 Jan 2025 12:58:50 +0000 To: plaisthos Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: Iea477ac96b0dbaee24ca8d097a2e1958f70c5dd3 X-Gerrit-Change-Number: 851 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: cf72e261acfae6f7c3c7b02a1cd1cb871af4c0dc 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-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: Attention is currently required from: plaisthos. Hello plaisthos, 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_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.85.128.45 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.85.128.45 listed in bl.score.senderscore.com] 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_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.45 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.45 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -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_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: 1tVVeI-00020Q-JM Subject: [Openvpn-devel] [S] Change in openvpn[master]: openvpnserv: Fix some inconsistent usages of TEXT() 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, arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1820685663521200590?= X-GMAIL-MSGID: =?utf-8?q?1820685663521200590?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/851?usp=email to review the following change. Change subject: openvpnserv: Fix some inconsistent usages of TEXT() ...................................................................... openvpnserv: Fix some inconsistent usages of TEXT() In general you can't use multiple strings as argument to TEXT() since it just adds a L in front of the argument. So if you specifiy multiple arguments the later argument strings do not get the L. This does not seem to directly cause problems with our ASCII strings, but make the usage consistent with all the other code. That will help in case we remove the usage of TEXT(). Also include tapctl/basic.h in openvpnserv to make the macro environment consistent with tapctl and openvpnmsica. Change-Id: Iea477ac96b0dbaee24ca8d097a2e1958f70c5dd3 Signed-off-by: Frank Lichtenheld --- M src/openvpnserv/CMakeLists.txt M src/openvpnserv/common.c M src/openvpnserv/interactive.c M src/openvpnserv/service.c M src/openvpnserv/service.h 5 files changed, 13 insertions(+), 11 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/51/851/1 diff --git a/src/openvpnserv/CMakeLists.txt b/src/openvpnserv/CMakeLists.txt index 154e17c..ff03867 100644 --- a/src/openvpnserv/CMakeLists.txt +++ b/src/openvpnserv/CMakeLists.txt @@ -17,6 +17,7 @@ interactive.c service.c service.h validate.c validate.h + ../tapctl/basic.h ../openvpn/wfp_block.c ../openvpn/wfp_block.h openvpnserv_resources.rc ../openvpn/ring_buffer.h diff --git a/src/openvpnserv/common.c b/src/openvpnserv/common.c index 61a7296..a88a724 100644 --- a/src/openvpnserv/common.c +++ b/src/openvpnserv/common.c @@ -45,7 +45,7 @@ if (status != ERROR_SUCCESS) { SetLastError(status); - return MsgToEventLog(M_SYSERR, TEXT("Error querying registry value: HKLM\\SOFTWARE\\" PACKAGE_NAME "%ls\\%ls"), service_instance, value); + return MsgToEventLog(M_SYSERR, TEXT("Error querying registry value: HKLM\\SOFTWARE\\") TEXT(PACKAGE_NAME) TEXT("%ls\\%ls"), service_instance, value); } return ERROR_SUCCESS; @@ -63,7 +63,7 @@ TCHAR install_path[MAX_PATH]; TCHAR default_value[MAX_PATH]; - swprintf(reg_path, _countof(reg_path), TEXT("SOFTWARE\\" PACKAGE_NAME "%ls"), service_instance); + swprintf(reg_path, _countof(reg_path), TEXT("SOFTWARE\\") TEXT(PACKAGE_NAME) TEXT("%ls"), service_instance); LONG status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, reg_path, 0, KEY_READ, &key); if (status != ERROR_SUCCESS) diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index 67f5bbc..35753b7 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -60,9 +60,9 @@ openvpn_service_t interactive_service = { interactive, - TEXT(PACKAGE_NAME "ServiceInteractive"), - TEXT(PACKAGE_NAME " Interactive Service"), - TEXT(SERVICE_DEPENDENCIES), + TEXT(PACKAGE_NAME) TEXT("ServiceInteractive"), + TEXT(PACKAGE_NAME) TEXT(" Interactive Service"), + SERVICE_DEPENDENCIES, SERVICE_AUTO_START }; @@ -1973,7 +1973,7 @@ } swprintf(ovpn_pipe_name, _countof(ovpn_pipe_name), - TEXT("\\\\.\\pipe\\" PACKAGE "%ls\\service_%lu"), service_instance, GetCurrentThreadId()); + TEXT("\\\\.\\pipe\\") TEXT(PACKAGE) TEXT("%ls\\service_%lu"), service_instance, GetCurrentThreadId()); ovpn_pipe = CreateNamedPipe(ovpn_pipe_name, PIPE_ACCESS_DUPLEX | FILE_FLAG_FIRST_PIPE_INSTANCE | FILE_FLAG_OVERLAPPED, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, 1, 128, 128, 0, NULL); @@ -2173,7 +2173,7 @@ } TCHAR pipe_name[256]; /* The entire pipe name string can be up to 256 characters long according to MSDN. */ - swprintf(pipe_name, _countof(pipe_name), TEXT("\\\\.\\pipe\\" PACKAGE "%ls\\service"), service_instance); + swprintf(pipe_name, _countof(pipe_name), TEXT("\\\\.\\pipe\\") TEXT(PACKAGE) TEXT("%ls\\service"), service_instance); HANDLE pipe = CreateNamedPipe(pipe_name, flags, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_REJECT_REMOTE_CLIENTS, PIPE_UNLIMITED_INSTANCES, 1024, 1024, 0, &sa); diff --git a/src/openvpnserv/service.c b/src/openvpnserv/service.c index a71f5c6..054fc5f 100644 --- a/src/openvpnserv/service.c +++ b/src/openvpnserv/service.c @@ -282,8 +282,8 @@ wprintf(TEXT("-instance interactive \n") TEXT(" Runs the service as an alternate instance.\n") TEXT(" The service settings will be loaded from\n") - TEXT(" HKLM\\Software\\" PACKAGE_NAME " registry key, and the service will accept\n") - TEXT(" requests on \\\\.\\pipe\\" PACKAGE "\\service named pipe.\n")); + TEXT(" HKLM\\Software\\") TEXT(PACKAGE_NAME) TEXT(" registry key, and the service will accept\n") + TEXT(" requests on \\\\.\\pipe\\") TEXT(PACKAGE) TEXT("\\service named pipe.\n")); return 0; } diff --git a/src/openvpnserv/service.h b/src/openvpnserv/service.h index 6b559a5..da20433 100644 --- a/src/openvpnserv/service.h +++ b/src/openvpnserv/service.h @@ -37,9 +37,10 @@ #include #include #include +#include "../tapctl/basic.h" -#define APPNAME TEXT(PACKAGE "serv") -#define SERVICE_DEPENDENCIES TAP_WIN_COMPONENT_ID "\0Dhcp\0\0" +#define APPNAME TEXT(PACKAGE) TEXT("serv") +#define SERVICE_DEPENDENCIES TEXT(TAP_WIN_COMPONENT_ID) TEXT("\0Dhcp\0\0") /* * Message handling