From patchwork Sun Mar 21 03:46:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kristof Provost via Openvpn-devel X-Patchwork-Id: 1644 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director11.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net with LMTP id yOryGItgV2D/ZwAAIUCqbw (envelope-from ) for ; Sun, 21 Mar 2021 11:04:43 -0400 Received: from proxy2.mail.ord1c.rsapps.net ([172.28.255.1]) by director11.mail.ord1d.rsapps.net with LMTP id AN7CGItgV2BFaAAAvGGmqA (envelope-from ) for ; Sun, 21 Mar 2021 11:04:43 -0400 Received: from smtp17.gate.ord1c ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy2.mail.ord1c.rsapps.net with LMTPS id +OeJGItgV2BZEgAA311kuQ (envelope-from ) for ; Sun, 21 Mar 2021 11:04:43 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp17.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=pass header.d=lists.sourceforge.net; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=pass (p=none; dis=none) header.from=lists.sourceforge.net X-Suspicious-Flag: NO X-Classification-ID: c3decfb0-8a56-11eb-8492-bc305beffb0c-1-1 Received: from [216.105.38.7] ([216.105.38.7:60710] helo=lists.sourceforge.net) by smtp17.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 7F/FE-22606-A8067506; Sun, 21 Mar 2021 11:04:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To:Sender:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=DAQLK/MKLx6Kwq/rl7AyBgvUc2Fpr17KcIeUJc85+wo=; b=hVVXMp1+/VpaU8N+iUqRpjfCiA MKS9LCC/eIvblSWkQ3viPcLJy5Rq9ZFPWOA7ePk/ubDqwYNMskDHGRJ4UHzt4bt/HvbzGWJafmMOr lks0xwuW0YBUtQkFCDSWyEeeju53N8u5YMUSi0vKDrlOj+Pu6lABTd3nYoa1k98juzaM=; 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.90_1) (envelope-from ) id 1lNzcO-0003hk-Su; Sun, 21 Mar 2021 15:03:52 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNzcM-0003ha-5I for openvpn-devel@lists.sourceforge.net; Sun, 21 Mar 2021 15:03:50 +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: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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=UBF2VHSRPyR4Lckjkc6zBb4VR5SjZKp1TMyB74f1now=; b=EVnwdTRYh6460aOGcyOnSivJlh qpPaJZOlCF95O9HGyShiQKKDQhXWL+TNPgs4p1vAk0aHKcjrhdVpz3KHJPI5Ts7V4TVXrjmOQkxOp zr08d4IV80nJ+WobVCUKdYdB+IVMJ+BiAMeYxQjI+XE5eQw0Z3ObUaWdYv0Kf+C5j9X8=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version: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:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=UBF2VHSRPyR4Lckjkc6zBb4VR5SjZKp1TMyB74f1now=; b=m ofqa8uB2AEqkbruqauDiR9HjGeONiCF4cM1Ot2qpTzwWSTRf5dhyaxyriRhFy3sFClV+G+TXlmYb+ nY5P8WkqiWfJ4NeHn7snbeJX/bnm5ng8OuCMjwApsETzm4Etfoan335Iq62I18TeY6elNDKr5JBt6 hOwMU2RF5u/qQNu4=; Received: from krn.amebis.si ([93.103.235.207]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lNzcG-0007cF-My for openvpn-devel@lists.sourceforge.net; Sun, 21 Mar 2021 15:03:50 +0000 Received: by krn.amebis.si (Postfix, from userid 982) id 8C85D18E878C; Sun, 21 Mar 2021 15:46:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1616338001; bh=UBF2VHSRPyR4Lckjkc6zBb4VR5SjZKp1TMyB74f1now=; h=From:To:Cc:Subject:Date:From; b=GIm/Xy8LdhjGQYM/h9ARQfZCs6kWOygnrWRg2FxG0IpY8cCr1TtPMLKc0qv+8d24V LK/v+UY+jRY7qO5NwOHnkJRUjGTCXcNfAZaoxcLkJyLfMsC1W6ebh8XCi0P7avlcNQ M5xjTASV90Zfk6ganTcav0Ts/0ulw+fGz8bFgaSI= X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on krn.amebis.doma X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Received: from SR6.amebis.doma (unknown [IPv6:2a01:260:4101:1464:8095:bdbd:413f:700f]) by krn.amebis.si (Postfix) with ESMTP id 9EA1818E8787; Sun, 21 Mar 2021 15:46:39 +0100 (CET) To: openvpn-devel@lists.sourceforge.net Date: Sun, 21 Mar 2021 15:46:23 +0100 Message-Id: <20210321144627.1621-1-simon@rozman.si> X-Mailer: git-send-email 2.30.0.windows.2 MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rozman.si] -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_AU Message has a valid DKIM or DK signature from author's 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 X-Headers-End: 1lNzcG-0007cF-My Subject: [Openvpn-devel] [PATCH 1/5] MSVC: Disable LZ4 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: , X-Patchwork-Original-From: Simon Rozman via Openvpn-devel From: Kristof Provost via Openvpn-devel Reply-To: Simon Rozman Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Commit 24596b25 ("build: Remove compat-lz4") removed lz4 compat layer, but openvpn-build\msvc doesn't provide LZ4 library either. Signed-off-by: Simon Rozman --- config-msvc.h | 1 - 1 file changed, 1 deletion(-) diff --git a/config-msvc.h b/config-msvc.h index e430ca96..53d97902 100644 --- a/config-msvc.h +++ b/config-msvc.h @@ -9,7 +9,6 @@ #define ENABLE_FRAGMENT 1 #define ENABLE_HTTP_PROXY 1 #define ENABLE_LZO 1 -#define ENABLE_LZ4 1 #define ENABLE_MANAGEMENT 1 #define ENABLE_MULTIHOME 1 #define ENABLE_PKCS11 1 From patchwork Sun Mar 21 03:46:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kristof Provost via Openvpn-devel X-Patchwork-Id: 1643 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net with LMTP id iJJAGIpgV2CxDwAAIUCqbw (envelope-from ) for ; Sun, 21 Mar 2021 11:04:42 -0400 Received: from proxy6.mail.ord1c.rsapps.net ([172.28.255.1]) by director9.mail.ord1d.rsapps.net with LMTP id +JDcF4pgV2CgRwAAalYnBA (envelope-from ) for ; Sun, 21 Mar 2021 11:04:42 -0400 Received: from smtp18.gate.ord1c ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy6.mail.ord1c.rsapps.net with LMTPS id OHl9F4pgV2CWSgAA9sKXow (envelope-from ) for ; Sun, 21 Mar 2021 11:04:42 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp18.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=pass header.d=lists.sourceforge.net; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=pass (p=none; dis=none) header.from=lists.sourceforge.net X-Suspicious-Flag: NO X-Classification-ID: c359cf22-8a56-11eb-8038-bc305bf00c68-1-1 Received: from [216.105.38.7] ([216.105.38.7:60704] helo=lists.sourceforge.net) by smtp18.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 3B/E1-10283-98067506; Sun, 21 Mar 2021 11:04:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:To:Sender:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FDYbeSsroN2y+3shI64vi2NQ2W4wvTX79C+osOLs8Zc=; b=c6JuKwkk4+0KSs2xZ7qITs9hF vCAWHEQcMTW/Zs1KuU8IfFfUf90Uk3cmL1VRQhCeSC25sF7ZfX+xymTGh6edgKAihP6ym4BqHg1Tp 4Dg0xqoOyGFNXjlv85qeZUJr9iJtpHX7OrWMGjlwitfPTnWDTBhAwlYKTjtB+FjJS/Eg0=; 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.90_1) (envelope-from ) id 1lNzcS-0003iQ-5Q; Sun, 21 Mar 2021 15:03:56 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNzcO-0003hj-Sr for openvpn-devel@lists.sourceforge.net; Sun, 21 Mar 2021 15:03:52 +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=FcdfLTlpkwX+bRZKS97+8Uv4axyIt+zZyd2/Y/YY+fA=; b=EYeifkvmHfsrVU28lfPan/n8y7 Vh9afIFZfsQpAP2QnafxWMT/+88BcK+0fq4FsJqq5Sk4ey2JDnmwjPRIChgweKDfKtvhON7Ri+gXA C7+eYZtEEwL6dJeimF6kiRLH+brWQLTZ5MQvMs8WPUImDxAcTaunkXj8vSSKWBafsgPE=; 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=FcdfLTlpkwX+bRZKS97+8Uv4axyIt+zZyd2/Y/YY+fA=; b=h8D5yG7nIi/Ga9uy0Ix/4JqnyC 7Ii8VM/zgJcVhr0if8/JE/8/2XhEqIop26r7uu8JNA09iYHM7iBjqrssZK3Hp7kki+JfIlfgG1Avl mmJt/lvWemxS0JgC4/QTH1o1EkUeO85X+q9Ybpy/PdEiRSrgDacHjLJAxhFdyZdyjv3I=; Received: from krn.amebis.si ([93.103.235.207]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1lNzcG-00AHq0-Mx for openvpn-devel@lists.sourceforge.net; Sun, 21 Mar 2021 15:03:52 +0000 Received: by krn.amebis.si (Postfix, from userid 982) id 608B718E878E; Sun, 21 Mar 2021 15:46:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1616338003; bh=FcdfLTlpkwX+bRZKS97+8Uv4axyIt+zZyd2/Y/YY+fA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eRxecGDhOh0IMEKux/ehLmV8J2dvegGx8NoadbLbYquJgR8pem5ZJw+9PFO3YpFHs Gq1QrRuPBT8XIQH1FrBvO46PiwyUdf56Q5yI0qgaes1Lg5wJPEKetn4Ic67BLXwukf sb6br9kS22pheAIcWktY+P7MWoSCssQVEEmPk/tE= X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on krn.amebis.doma X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Received: from SR6.amebis.doma (unknown [IPv6:2a01:260:4101:1464:8095:bdbd:413f:700f]) by krn.amebis.si (Postfix) with ESMTP id EA1FE18E878A; Sun, 21 Mar 2021 15:46:40 +0100 (CET) To: openvpn-devel@lists.sourceforge.net Date: Sun, 21 Mar 2021 15:46:24 +0100 Message-Id: <20210321144627.1621-2-simon@rozman.si> X-Mailer: git-send-email 2.30.0.windows.2 In-Reply-To: <20210321144627.1621-1-simon@rozman.si> References: <20210321144627.1621-1-simon@rozman.si> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rozman.si] -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_AU Message has a valid DKIM or DK signature from author's 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 X-Headers-End: 1lNzcG-00AHq0-Mx Subject: [Openvpn-devel] [PATCH 2/5] tun.c: Remove dead code 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: , X-Patchwork-Original-From: Simon Rozman via Openvpn-devel From: Kristof Provost via Openvpn-devel Reply-To: Simon Rozman Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Signed-off-by: Simon Rozman Acked-By: Arne Schwabe --- src/openvpn/tun.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 6c51a52d..6b7c8ef1 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -85,8 +85,6 @@ static void netsh_command(const struct argv *a, int n, int msglevel); static const char *netsh_get_id(const char *dev_node, struct gc_arena *gc); -static DWORD get_adapter_index_flexible(const char *name); - static bool do_address_service(const bool add, const short family, const struct tuntap *tt) { @@ -4877,38 +4875,6 @@ get_adapter_index(const char *guid) return index; } -static DWORD -get_adapter_index_flexible(const char *name) /* actual name or GUID */ -{ - struct gc_arena gc = gc_new(); - DWORD index; - index = get_adapter_index_method_1(name); - if (index == TUN_ADAPTER_INDEX_INVALID) - { - index = get_adapter_index_method_2(name); - } - if (index == TUN_ADAPTER_INDEX_INVALID) - { - const struct tap_reg *tap_reg = get_tap_reg(&gc); - const struct panel_reg *panel_reg = get_panel_reg(&gc); - const struct tap_reg *tr = get_adapter_by_name(name, tap_reg, panel_reg); - if (tr) - { - index = get_adapter_index_method_1(tr->guid); - if (index == TUN_ADAPTER_INDEX_INVALID) - { - index = get_adapter_index_method_2(tr->guid); - } - } - } - if (index == TUN_ADAPTER_INDEX_INVALID) - { - msg(M_INFO, "NOTE: could not get adapter index for name/GUID '%s'", name); - } - gc_free(&gc); - return index; -} - /* * Return a string representing a PIP_ADDR_STRING */ From patchwork Sun Mar 21 03:46:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kristof Provost via Openvpn-devel X-Patchwork-Id: 1646 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net with LMTP id YDb4L4xgV2CuagAAIUCqbw (envelope-from ) for ; Sun, 21 Mar 2021 11:04:44 -0400 Received: from proxy8.mail.ord1c.rsapps.net ([172.28.255.1]) by director9.mail.ord1d.rsapps.net with LMTP id 0EPQL4xgV2ClRwAAalYnBA (envelope-from ) for ; Sun, 21 Mar 2021 11:04:44 -0400 Received: from smtp33.gate.ord1c ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy8.mail.ord1c.rsapps.net with LMTPS id qLKOL4xgV2BlHAAAHz/atg (envelope-from ) for ; Sun, 21 Mar 2021 11:04:44 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp33.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=pass header.d=lists.sourceforge.net; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=pass (p=none; dis=none) header.from=lists.sourceforge.net X-Suspicious-Flag: NO X-Classification-ID: c4d0854e-8a56-11eb-a3a7-54520067fec4-1-1 Received: from [216.105.38.7] ([216.105.38.7:34130] helo=lists.sourceforge.net) by smtp33.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 8F/80-06632-C8067506; Sun, 21 Mar 2021 11:04:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:To:Sender:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hnSI+xxFgZFqthBRPDdLc6LXs+oAutomhXcaZk4JHos=; b=S+rfIeR2rMzGpVgwmr6txVzvE 5yX2fqvEoJIinfVw/kBqA8OPOoB6hZfkE/BdTlRF7CNSd2xI1dJqgfJx+7RLHuWcHXdwac3xG24I6 Q6S9IKH4O+69lH6TFr9mAdUof7QGLjEVb6pw0mCesbMEyZka+YIcWeumSV2d+NAk42xI8=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1lNzcV-0006Ba-Lq; Sun, 21 Mar 2021 15:03:59 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNzcO-0006AN-TL for openvpn-devel@lists.sourceforge.net; Sun, 21 Mar 2021 15:03:52 +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=6Xs8k8X8Mipb+vPkul/qGIeYXsEX7A5USm0G7l0MwB0=; b=gbymE9xapm0+tfQTp1hChmDErw vjqp8XJcOHGeYdAEhwr7UOLO5CIeItHXJJD0lAwoRv9lCNX57P5ghG7ocjwi792ISts4Poy/Uksou qbXI8gNW+obtWe9ZhfI4p1NYD8eWtmxnts71VVSNMmh3hIz14nuMlLdp17y7W8tRP6LE=; 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=6Xs8k8X8Mipb+vPkul/qGIeYXsEX7A5USm0G7l0MwB0=; b=UqEu59PMV8Wzl36qI7Q83NzUDK EmvT8zK2Ac0/yz1yN/9vgr4A3P7ES74n0gmkw/JMsXqT6dW+WhynVywdxIFghAh10IHJNWptOMKHk oEy61Cy/5Py1tv9V9b/THAwElIipR7s8a5yWbYcvDfOyfQKNivWfSW/cwU0OQY77uCHM=; Received: from krn.amebis.si ([93.103.235.207]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1lNzcG-00AHpz-M6 for openvpn-devel@lists.sourceforge.net; Sun, 21 Mar 2021 15:03:52 +0000 Received: by krn.amebis.si (Postfix, from userid 982) id 9E8E318E878F; Sun, 21 Mar 2021 15:46:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1616338004; bh=6Xs8k8X8Mipb+vPkul/qGIeYXsEX7A5USm0G7l0MwB0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JUK99FYkyPMnfVnqcR1YE/0c7NlA7iNS34IE+OTMKA7GUJN6kcJ4EE5kLKpnuPaJN PgX5FTSyOoXk/qVJ4RevuGxxROxJBAJFtPZKRAnLI32nEn5tBMOKx+px0+vBuwZf09 o/JN6313tfJree2WBdT4f9CHlv1mED+nBpnwITFc= X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on krn.amebis.doma X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Received: from SR6.amebis.doma (unknown [IPv6:2a01:260:4101:1464:8095:bdbd:413f:700f]) by krn.amebis.si (Postfix) with ESMTP id 57CD718E8787; Sun, 21 Mar 2021 15:46:42 +0100 (CET) To: openvpn-devel@lists.sourceforge.net Date: Sun, 21 Mar 2021 15:46:25 +0100 Message-Id: <20210321144627.1621-3-simon@rozman.si> X-Mailer: git-send-email 2.30.0.windows.2 In-Reply-To: <20210321144627.1621-1-simon@rozman.si> References: <20210321144627.1621-1-simon@rozman.si> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rozman.si] -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_AU Message has a valid DKIM or DK signature from author's 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 X-Headers-End: 1lNzcG-00AHpz-M6 Subject: [Openvpn-devel] [PATCH 3/5] interactive.c: Resolve MSVC C4996 warning 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: , X-Patchwork-Original-From: Simon Rozman via Openvpn-devel From: Kristof Provost via Openvpn-devel Reply-To: Simon Rozman Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox It's about using a standard recommended alias for the wcsdup(): > warning C4996: 'wcsdup': The POSIX name for this item is deprecated. > Instead, use the ISO C and C++ conformant name: _wcsdup. See online > help for details. And the documentation says: > The Microsoft-implemented POSIX function names strdup and wcsdup are > deprecated aliases for the _strdup and _wcsdup functions. By default, > they generate Compiler warning (level 3) C4996. The names are > deprecated because they don't follow the Standard C rules for > implementation-specific names. However, the functions are still > supported. > > We recommend you use _strdup and _wcsdup instead. Or, you can continue > to use these function names, and disable the warning. For more > information, see Turn off the warning and POSIX function names. Reference: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strdup-wcsdup Signed-off-by: Simon Rozman Acked-By: Arne Schwabe --- src/openvpnserv/interactive.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index 5d5cbfe6..b073a0d5 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -899,7 +899,7 @@ ExecCommand(const WCHAR *argv0, const WCHAR *cmdline, DWORD timeout) si.cb = sizeof(si); /* CreateProcess needs a modifiable cmdline: make a copy */ - cmdline_dup = wcsdup(cmdline); + cmdline_dup = _wcsdup(cmdline); if (cmdline_dup && CreateProcessW(argv0, cmdline_dup, NULL, NULL, FALSE, proc_flags, NULL, NULL, &si, &pi) ) { @@ -1181,7 +1181,7 @@ SetDNSDomain(const wchar_t *if_name, const char *domain, undo_lists_t *lists) /* Add to undo list if domain is non-empty */ if (err == 0 && wdomain[0] && lists) { - wchar_t *tmp_name = wcsdup(if_name); + wchar_t *tmp_name = _wcsdup(if_name); if (!tmp_name || AddListItem(&(*lists)[undo_domain], tmp_name)) { free(tmp_name); @@ -1272,7 +1272,7 @@ HandleDNSConfigMessage(const dns_cfg_message_t *msg, undo_lists_t *lists) if (msg->addr_len > 0) { - wchar_t *tmp_name = wcsdup(wide_name); + wchar_t *tmp_name = _wcsdup(wide_name); if (!tmp_name || AddListItem(&(*lists)[undo_type], tmp_name)) { free(tmp_name); From patchwork Sun Mar 21 03:46:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kristof Provost via Openvpn-devel X-Patchwork-Id: 1642 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director13.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id GCarDIlgV2CxDwAAIUCqbw (envelope-from ) for ; Sun, 21 Mar 2021 11:04:41 -0400 Received: from proxy19.mail.ord1d.rsapps.net ([172.30.191.6]) by director13.mail.ord1d.rsapps.net with LMTP id mCt2DIlgV2CYWwAA91zNiA (envelope-from ) for ; Sun, 21 Mar 2021 11:04:41 -0400 Received: from smtp3.gate.ord1c ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy19.mail.ord1d.rsapps.net with LMTPS id wLEnDIlgV2BQeAAAyH2SIw (envelope-from ) for ; Sun, 21 Mar 2021 11:04:41 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp3.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=pass header.d=lists.sourceforge.net; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=pass (p=none; dis=none) header.from=lists.sourceforge.net X-Suspicious-Flag: NO X-Classification-ID: c2a3f2e2-8a56-11eb-8a4a-842b2b47481a-1-1 Received: from [216.105.38.7] ([216.105.38.7:34438] helo=lists.sourceforge.net) by smtp3.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id AF/BE-14603-88067506; Sun, 21 Mar 2021 11:04:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:To:Sender:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=emLz0Ri+AiT7d+6U6fb4uF1u9InbkiKoxbcoyqWV4Ts=; b=UpoiQr6QBHuABtmc3UgzyY8a1 JSwJkCGOCmA9bzPPo0cUzS2DkKsw4H4Qkm3qPzUrPDxO0htypG5W5+yL6VHZHwvatPZ8X1D5n8Ly+ c5/CphLnsiSHM87jaOf60oAgx2HQ5DkqXQizQPlY7n8YBKVN1ebUKoY5EQOR+jjVOYYoY=; 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.92.3) (envelope-from ) id 1lNzcQ-000147-0R; Sun, 21 Mar 2021 15:03:54 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1lNzcO-000140-TL for openvpn-devel@lists.sourceforge.net; Sun, 21 Mar 2021 15:03:52 +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=FfNJnfDy+UfR0Vu4Wrgl1m2WoMrO+wt4HasQITtbID4=; b=DyWmk4i5radFIstoYtEhoB4v/l TuJFFjtyTAdm2+dt0EpGNk9ZXVgxRkvwfHwoMUXu8NE7PTJ81H16vR9vXBFVo0I2hYFwftLVm5ZwS NhYcIQFvgYACJYZcOazVlyDRiN/zMtyAE3YZxFnml6lO1GIo9yTwob5Dk3TRZ2qO2r/U=; 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=FfNJnfDy+UfR0Vu4Wrgl1m2WoMrO+wt4HasQITtbID4=; b=Q31Sc1uMZtvIvOSF6hzIMt/H/k 8OLU88gsuyGG+9u7yYBgwm0wTwpvCYI23BBBNtWi1HBTWSM+j4PSfJj2EtTBqDrOLmVSqr692JGf9 FQhrlfJcpdt3MXyptv4mH1myu+e6oDi0tRSnxn254V9WnJfn96U4aX8eOXY5S+XUpG/8=; Received: from krn.amebis.si ([93.103.235.207]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lNzcG-0007cE-Ly for openvpn-devel@lists.sourceforge.net; Sun, 21 Mar 2021 15:03:52 +0000 Received: by krn.amebis.si (Postfix, from userid 982) id 9054918E8787; Sun, 21 Mar 2021 15:46:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1616338005; bh=FfNJnfDy+UfR0Vu4Wrgl1m2WoMrO+wt4HasQITtbID4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YCWezT22UvjgjV7r//Whzkb1IXSl0RYWHIcRJldDc0B5awwHS06lbS976bufJruRm c6f38y8iHNoECG57C6Rid5dZqSK/2ebe0rsf18cbO9PY0R96cLWuzKv8fedfAxnPB9 Y7n0MoplAXqpIj9zXZsJYsp5CnsFbtuF3fHWaGRM= X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on krn.amebis.doma X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.4 Received: from SR6.amebis.doma (unknown [IPv6:2a01:260:4101:1464:8095:bdbd:413f:700f]) by krn.amebis.si (Postfix) with ESMTP id EC23F18E878B; Sun, 21 Mar 2021 15:46:42 +0100 (CET) To: openvpn-devel@lists.sourceforge.net Date: Sun, 21 Mar 2021 15:46:26 +0100 Message-Id: <20210321144627.1621-4-simon@rozman.si> X-Mailer: git-send-email 2.30.0.windows.2 In-Reply-To: <20210321144627.1621-1-simon@rozman.si> References: <20210321144627.1621-1-simon@rozman.si> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rozman.si] -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_AU Message has a valid DKIM or DK signature from author's 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 X-Headers-End: 1lNzcG-0007cE-Ly Subject: [Openvpn-devel] [PATCH 4/5] tapctl: Resolve MSVC C4996 warnings 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: , X-Patchwork-Original-From: Simon Rozman via Openvpn-devel From: Kristof Provost via Openvpn-devel Reply-To: Simon Rozman Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox wcsncat() was declared unsafe in favour of wcsncat_s(). However, the string concatenation follows the string length check, making wcsncat() safe too. Code analysis is just not smart enough (yet) to detect this. The code was refactored to use wcscat_s() MSVC is considering as "safe". Signed-off-by: Simon Rozman --- src/tapctl/tap.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/tapctl/tap.c b/src/tapctl/tap.c index dd4a10a3..3f76c43a 100644 --- a/src/tapctl/tap.c +++ b/src/tapctl/tap.c @@ -2,7 +2,7 @@ * tapctl -- Utility to manipulate TUN/TAP adapters on Windows * https://community.openvpn.net/openvpn/wiki/Tapctl * - * Copyright (C) 2018-2020 Simon Rozman + * Copyright (C) 2018-2021 Simon Rozman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 @@ -73,14 +73,13 @@ find_function(const WCHAR *libname, const char *funcname, HMODULE *m) return NULL; } - size_t len = _countof(libpath) - wcslen(libpath) - 1; - if (len < wcslen(libname) + 1) + if (wcslen(libpath) + 1 /*\*/ + wcslen(libname) >= _countof(libpath)) { SetLastError(ERROR_INSUFFICIENT_BUFFER); return NULL; } - wcsncat(libpath, L"\\", len); - wcsncat(libpath, libname, len-1); + wcscat_s(libpath, _countof(libpath), L"\\"); + wcscat_s(libpath, _countof(libpath), libname); *m = LoadLibraryW(libpath); if (*m == NULL) From patchwork Sun Mar 21 03:46:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kristof Provost via Openvpn-devel X-Patchwork-Id: 1645 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director14.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id 6MnpJ4tgV2BUUAAAIUCqbw (envelope-from ) for ; Sun, 21 Mar 2021 11:04:43 -0400 Received: from proxy18.mail.ord1d.rsapps.net ([172.30.191.6]) by director14.mail.ord1d.rsapps.net with LMTP id KPbSJ4tgV2CoQgAAeJ7fFg (envelope-from ) for ; Sun, 21 Mar 2021 11:04:43 -0400 Received: from smtp15.gate.ord1c ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy18.mail.ord1d.rsapps.net with LMTPS id cBh4J4tgV2B6TwAATCaURg (envelope-from ) for ; Sun, 21 Mar 2021 11:04:43 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp15.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=pass header.d=lists.sourceforge.net; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=pass (p=none; dis=none) header.from=lists.sourceforge.net X-Suspicious-Flag: NO X-Classification-ID: c43dccb8-8a56-11eb-a620-bc305bf03694-1-1 Received: from [216.105.38.7] ([216.105.38.7:60718] helo=lists.sourceforge.net) by smtp15.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 00/7B-23666-B8067506; Sun, 21 Mar 2021 11:04:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:To:Sender:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7YtCiHoWQXTakvGI/skZpzbLdpokXbUJkyVY1h0ns+U=; b=GMjC4gDgZ446Wh8ZNrix626Gs mSoZyUkklf/aTxQKpkc0GllK/h3MPMYw5XlIWqJNboGu9MbOWkSDrcT/ZOCRhAltiVf7nG5V5yVUE 2c5l54c2/mVGpL+TFdKowE/T/kp8CYjy1C9iKrCBDVv92BYVMoFwRTM0tpiNp5y/oywQs=; 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.90_1) (envelope-from ) id 1lNzcT-0003ir-8e; Sun, 21 Mar 2021 15:03:57 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNzcO-0003hl-TI for openvpn-devel@lists.sourceforge.net; Sun, 21 Mar 2021 15:03:52 +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=JEaF/HRSKa7i8ETS/IoV8T7YC/9wvBG8PfNJqH/FQPI=; b=S7BQlPqexZoTz4jSel70hKft6L o7hujM9SjqdPi6ZdvyQdIZrVI+oWgBY3rV/UKPfhsiOOntiGswTcm8llbMGdFlauXB9L4GJ6Cp2hZ ckv8+0fRjt06aJZY4gbIzP7fVRpl+b2GHodHeLUfMBznsJi0NXdLY9dAQzK+r69W4ecc=; 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=JEaF/HRSKa7i8ETS/IoV8T7YC/9wvBG8PfNJqH/FQPI=; b=ez7CBKQCqChAR6yH/owiSUv27h XAjNeIsBOs6DYQsAW9hjNEv5d4NOUhvSY/w5d8x0hh5RX2RG1UNyHbN67/wQhvdTXzAVtWFUNV6dU qBwCehYm/IXIU34coT3OE5GKbAjeUiZChUQvW5Xh7rGPaN8QnRhJpET+m4RfyZH0rWjs=; Received: from krn.amebis.si ([93.103.235.207]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lNzcG-0007cD-Ly for openvpn-devel@lists.sourceforge.net; Sun, 21 Mar 2021 15:03:52 +0000 Received: by krn.amebis.si (Postfix, from userid 982) id 65E3318E878B; Sun, 21 Mar 2021 15:46:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1616338006; bh=JEaF/HRSKa7i8ETS/IoV8T7YC/9wvBG8PfNJqH/FQPI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VdAa+tG2RMejVrcgpLemkDc2vfKdsU5GW5jUyVqiCGtnwlqPgNHN6aG9grbK/+Jtj 8yIajaVv0IxRiCLO/MIUsDrhANdU5E9WiJqE+qT3Ysd/tpBTkklpyCohqp0BQlBlfA jk6O+ppMVmAbPeWvgxR/A/PddrG1vmcN9UMhZxu8= X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on krn.amebis.doma X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Received: from SR6.amebis.doma (unknown [IPv6:2a01:260:4101:1464:8095:bdbd:413f:700f]) by krn.amebis.si (Postfix) with ESMTP id C13C718E878A; Sun, 21 Mar 2021 15:46:43 +0100 (CET) To: openvpn-devel@lists.sourceforge.net Date: Sun, 21 Mar 2021 15:46:27 +0100 Message-Id: <20210321144627.1621-5-simon@rozman.si> X-Mailer: git-send-email 2.30.0.windows.2 In-Reply-To: <20210321144627.1621-1-simon@rozman.si> References: <20210321144627.1621-1-simon@rozman.si> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rozman.si] -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_AU Message has a valid DKIM or DK signature from author's 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 X-Headers-End: 1lNzcG-0007cD-Ly Subject: [Openvpn-devel] [PATCH 5/5] iservice: Resolve MSVC C4996 warnings 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: , X-Patchwork-Original-From: Simon Rozman via Openvpn-devel From: Kristof Provost via Openvpn-devel Reply-To: Simon Rozman Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Lots of string functions were declared unsafe in favor of ..._s() counterparts. However, the code already is careful about the buffer size. Code analysis is just not smart enough (yet) to detect this. The code was refactored to use ..._s() variants MSVC is considering as "safe". Signed-off-by: Simon Rozman Acked-By: Arne Schwabe --- src/openvpnserv/automatic.c | 8 ++++---- src/openvpnserv/common.c | 4 ++-- src/openvpnserv/interactive.c | 2 +- src/openvpnserv/service.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openvpnserv/automatic.c b/src/openvpnserv/automatic.c index 3f2ca345..0ba222a0 100644 --- a/src/openvpnserv/automatic.c +++ b/src/openvpnserv/automatic.c @@ -137,7 +137,7 @@ modext(LPTSTR dest, size_t size, LPCTSTR src, LPCTSTR newext) if (size > 0 && (_tcslen(src) + 1) <= size) { - _tcscpy(dest, src); + _tcscpy_s(dest, size, src); dest [size - 1] = TEXT('\0'); i = _tcslen(dest); while (i-- > 0) @@ -154,8 +154,8 @@ modext(LPTSTR dest, size_t size, LPCTSTR src, LPCTSTR newext) } if (_tcslen(dest) + _tcslen(newext) + 2 <= size) { - _tcscat(dest, TEXT(".")); - _tcscat(dest, newext); + _tcscat_s(dest, size, TEXT(".")); + _tcscat_s(dest, size, newext); return true; } dest[0] = TEXT('\0'); @@ -271,7 +271,7 @@ ServiceStartAutomatic(DWORD dwArgc, LPTSTR *lpszArgv) BOOL more_files; TCHAR find_string[MAX_PATH]; - openvpn_sntprintf(find_string, MAX_PATH, TEXT("%s\\*"), settings.config_dir); + openvpn_sntprintf(find_string, _countof(find_string), TEXT("%s\\*"), settings.config_dir); find_handle = FindFirstFile(find_string, &find_obj); if (find_handle == INVALID_HANDLE_VALUE) diff --git a/src/openvpnserv/common.c b/src/openvpnserv/common.c index 958643df..48769be4 100644 --- a/src/openvpnserv/common.c +++ b/src/openvpnserv/common.c @@ -37,7 +37,7 @@ openvpn_vsntprintf(LPTSTR str, size_t size, LPCTSTR format, va_list arglist) int len = -1; if (size > 0) { - len = _vsntprintf(str, size, format, arglist); + len = _vsntprintf_s(str, size, _TRUNCATE, format, arglist); str[size - 1] = 0; } return (len >= 0 && (size_t)len < size); @@ -311,7 +311,7 @@ get_win_sys_path(void) if (!GetSystemDirectoryW(win_sys_path, _countof(win_sys_path))) { - wcsncpy(win_sys_path, default_sys_path, _countof(win_sys_path)); + wcscpy_s(win_sys_path, _countof(win_sys_path), default_sys_path); win_sys_path[_countof(win_sys_path) - 1] = L'\0'; } diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index b073a0d5..ed83d2a3 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -1067,7 +1067,7 @@ netsh_dns_cmd(const wchar_t *action, const wchar_t *proto, const wchar_t *if_nam if (IsWindows7OrGreater()) { - wcsncat(cmdline, L" validate=no", ncmdline - wcslen(cmdline) - 1); + wcscat_s(cmdline, ncmdline, L" validate=no"); } err = ExecCommand(argv0, cmdline, timeout); diff --git a/src/openvpnserv/service.c b/src/openvpnserv/service.c index 8efe25f9..8101f83d 100644 --- a/src/openvpnserv/service.c +++ b/src/openvpnserv/service.c @@ -61,14 +61,14 @@ CmdInstallServices() TCHAR path[512]; int i, ret = _service_max; - if (GetModuleFileName(NULL, path + 1, 510) == 0) + if (GetModuleFileName(NULL, path + 1, _countof(path) - 2) == 0) { _tprintf(TEXT("Unable to install service - %s\n"), GetLastErrorText()); return 1; } path[0] = TEXT('\"'); - _tcscat(path, TEXT("\"")); + _tcscat_s(path, _countof(path), TEXT("\"")); svc_ctl_mgr = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT | SC_MANAGER_CREATE_SERVICE); if (svc_ctl_mgr == NULL)