From patchwork Wed Oct 24 16:05:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selva Nair X-Patchwork-Id: 576 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id kFIdFNM20VueTwAAIUCqbw for ; Wed, 24 Oct 2018 23:21:55 -0400 Received: from proxy1.mail.ord1d.rsapps.net ([172.30.191.6]) by director10.mail.ord1d.rsapps.net with LMTP id mOLpE9M20Vu7fAAApN4f7A ; Wed, 24 Oct 2018 23:21:55 -0400 Received: from smtp5.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy1.mail.ord1d.rsapps.net with LMTP id qF+yE9M20VumLwAAasrz9Q ; Wed, 24 Oct 2018 23:21:55 -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: smtp5.gate.ord1d.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=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: 1f0caea4-d805-11e8-908c-525400d73c44-1-1 Received: from [216.105.38.7] ([216.105.38.7:26177] helo=lists.sourceforge.net) by smtp5.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 72/38-12354-2D631DB5; Wed, 24 Oct 2018 23:21:54 -0400 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 1gFWCs-00008L-VU; Thu, 25 Oct 2018 03:21:10 +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 1gFWCr-00008C-Ms for openvpn-devel@lists.sourceforge.net; Thu, 25 Oct 2018 03:21:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding: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=ZrLyz4sscOgC6af5e2gF1hHI9snDO/C2k+6kcVT+aZ4=; b=CtGJZCc5BWo0GlOG4Yw6PBW/QG CUnSlhn31hIq7nVIvW/CTcli8QvvfuUEl7KNtsZwQW2MzL16iTNje06eoqBbWjAM99peW/xFaCKTj H/WC8bHhGXO1YmTq0ykUPCzOge2OFKfZVIckVSbCkFbubvshKY1iTa2mU5sTBYoRVAoU=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version: Content-Type:Content-Transfer-Encoding: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=ZrLyz4sscOgC6af5e2gF1hHI9snDO/C2k+6kcVT+aZ4=; b=lah2BToXdmEk/+NA3aKJO0g5is rYy/J8iRqvVfmz1dbuVKD3rZdsadaOwlmhn2D4U+0Fjve59M75uewXqSO2Uj2QDDOAHxNd3SvUAac PsSJS6AMN3qspwJOySMjuci8oK5sUMxVJINjiHc9W1GASFuQyqj08anf+feVKc4rtngc=; Received: from scala.nanotech.utoronto.ca ([128.100.226.29]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1gFWCq-002AOD-CB for openvpn-devel@lists.sourceforge.net; Thu, 25 Oct 2018 03:21:09 +0000 Received: by scala.nanotech.utoronto.ca (Postfix, from userid 1000) id 3B897813D5; Wed, 24 Oct 2018 23:05:18 -0400 (EDT) From: selva.nair@gmail.com To: openvpn-devel@lists.sourceforge.net Date: Wed, 24 Oct 2018 23:05:16 -0400 Message-Id: <1540436716-5725-1-git-send-email-selva.nair@gmail.com> X-Mailer: git-send-email 2.6.2 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (selva.nair[at]gmail.com) 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different 1.2 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list X-Headers-End: 1gFWCq-002AOD-CB Subject: [Openvpn-devel] [PATCH] Declare Windows version of openvpn_execve() before use 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: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox From: Selva Nair commit bf97c00f7dba441b504881f38e40afcbb610a39f moved the generic openvpn_execve() to run_command.c and made it static. But the Windows version is still in win32.c and is called from run_command.c Fix by declaring the function in win32.h Signed-off-by: Selva Nair Acked-by: Gert Doering --- This is an easy way out. In the spirit of commit bf97c00f7db, the entire win32 version of openvpn_execve() could move to run_command.c and become static. That will also require pulling wide_cmd_line() and env_block() out of win32.c. src/openvpn/win32.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/openvpn/win32.h b/src/openvpn/win32.h index b5cbe25..4b4524f 100644 --- a/src/openvpn/win32.h +++ b/src/openvpn/win32.h @@ -27,6 +27,7 @@ #include "mtu.h" #include "openvpn-msg.h" +#include "argv.h" /* location of executables */ #define SYS_PATH_ENV_VAR_NAME "SystemRoot" /* environmental variable name that normally contains the system path */ @@ -316,5 +317,11 @@ const char *win32_version_string(struct gc_arena *gc, bool add_name); bool send_msg_iservice(HANDLE pipe, const void *data, size_t size, ack_message_t *ack, const char *context); +/* + * Attempt to simulate fork/execve on Windows + */ +int +openvpn_execve(const struct argv *a, const struct env_set *es, const unsigned int flags); + #endif /* ifndef OPENVPN_WIN32_H */ #endif /* ifdef _WIN32 */