From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp52.i.mail.ru (smtp52.i.mail.ru [94.100.177.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 5006F44185F for ; Thu, 26 Mar 2020 03:23:11 +0300 (MSK) Date: Thu, 26 Mar 2020 03:23:14 +0300 From: Alexander Turenko Message-ID: <20200326002314.6couvb225onbeeqy@tkn_work_nb> References: <20200324100347.15405-1-gorcunov@gmail.com> <20200324100347.15405-2-gorcunov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200324100347.15405-2-gorcunov@gmail.com> Subject: Re: [Tarantool-patches] [PATCH 1/2] popen: do not require space for shell args List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov Cc: tml I still think that we should remove the POPEN_FLAG_SHELL option, because, in brief, it will simplify the popen engine API (see the last point in [1]), but okay: let's proceed with the fix and postpone the decision a bit. LGTM. [1]: https://lists.tarantool.org/pipermail/tarantool-patches/2020-March/014608.html On Tue, Mar 24, 2020 at 01:03:46PM +0300, Cyrill Gorcunov wrote: > In case of direct execute without using a shell there > is no need to require a caller to allocate redundant > space, lets pass executable name in first argument. > > Since this is yet testing api we're allowed to change > without breaking aything. > > Signed-off-by: Cyrill Gorcunov > --- > src/lib/core/popen.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c > index a0630e3d9..6b6062215 100644 > --- a/src/lib/core/popen.c > +++ b/src/lib/core/popen.c > @@ -945,7 +945,7 @@ popen_new(struct popen_opts *opts) > if (opts->flags & POPEN_FLAG_SHELL) > execve(_PATH_BSHELL, opts->argv, envp); > else > - execve(opts->argv[2], &opts->argv[2], envp); > + execve(opts->argv[0], opts->argv, envp); > exit_child: > _exit(errno); > unreachable(); > -- > 2.20.1 >