From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 95EBD3857730; Wed, 19 Apr 2023 19:09:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 95EBD3857730 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681931374; bh=7IC+jrKX56A8U7oUCDNOOkQfbyxL1gem1li8nFyTVQw=; h=From:To:Subject:Date:From; b=EYwp73xwoPQOKlUV1Q0wBfwBdH2WaTuHx88vZwpER2K3NR3gOJZirhpyCrRrp9esv NuMkqlfo6ZHfYfslOfyR34slOQpOp+BC+nQQ4OXwu/wsOPgxrsAAlXTK+IvJ9GGqfp ukqzIjNGykHQ4vRQ1MriQBylob3s8X37O2Iqee1w= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/main] Cygwin: posix_spawnp: don't fallback to sh X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: 3124d8b436a8130130ffe9c6a397556ff0125e66 X-Git-Newrev: da40bd6eaf400e102fca68cbe170465a4af6d49c Message-Id: <20230419190934.95EBD3857730@sourceware.org> Date: Wed, 19 Apr 2023 19:09:34 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dda40bd6eaf4= 00e102fca68cbe170465a4af6d49c commit da40bd6eaf400e102fca68cbe170465a4af6d49c Author: Corinna Vinschen AuthorDate: Wed Apr 19 21:04:49 2023 +0200 Commit: Corinna Vinschen CommitDate: Wed Apr 19 21:08:48 2023 +0200 Cygwin: posix_spawnp: don't fallback to sh =20 Per the discussion starting with https://cygwin.com/pipermail/cygwin/2023-April/253495.html stop falling back to sh if the file given to posix_spawnp is no executable. =20 This is not necessarily the last word on it, given https://www.austingroupbugs.net/view.php?id=3D1674, but for now, opt for following the proposal in the Austin Group bug entry, as well as PASSing the GNULIB test-posix_spawnp-script test. =20 Fixes: c7c1a1ca1b33 ("Add support for new posix_spawn function.") Fixes: 3fbfcd11fb09 ("Cygwin: posix_spawn: add Cygwin-specific code fix= ing process synchronisation") Reported-by: Bruno Haible Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/release/3.5.0 | 7 +++++++ winsup/cygwin/spawn.cc | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/release/3.5.0 b/winsup/cygwin/release/3.5.0 index f7c267616ee4..c8485b18c507 100644 --- a/winsup/cygwin/release/3.5.0 +++ b/winsup/cygwin/release/3.5.0 @@ -26,3 +26,10 @@ What's new: =20 - New API calls: posix_spawn_file_actions_addchdir_np, posix_spawn_file_actions_addfchdir_np. + +What changed: +------------- + +- posix_spawnp no longer falls back to starting the shell for unrecognized + files as execvp. For the reasoning, see + https://www.austingroupbugs.net/view.php?id=3D1674 diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 4d0ca127b944..84dd74e28fed 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -1392,8 +1392,7 @@ __posix_spawn_execvpe (const char *path, char * const= *argv, char *const *envp, ch_spawn.set_sem (sem); ch_spawn.worker (use_env_path ? (find_exec (path, buf, "PATH", FE_NNF) ?= : "") : path, - argv, envp, - _P_OVERLAY | (use_env_path ? _P_PATH_TYPE_EXEC : 0)); + argv, envp, _P_OVERLAY); __posix_spawn_sem_release (sem, errno); return -1; }