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);