public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/main] Cygwin: posix_spawnp: don't fallback to sh
@ 2023-04-19 19:09 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2023-04-19 19:09 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=da40bd6eaf400e102fca68cbe170465a4af6d49c

commit da40bd6eaf400e102fca68cbe170465a4af6d49c
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Wed Apr 19 21:04:49 2023 +0200
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Wed Apr 19 21:08:48 2023 +0200

    Cygwin: posix_spawnp: don't fallback to sh
    
    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.
    
    This is not necessarily the last word on it, given
    https://www.austingroupbugs.net/view.php?id=1674, 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.
    
    Fixes: c7c1a1ca1b33 ("Add support for new posix_spawn function.")
    Fixes: 3fbfcd11fb09 ("Cygwin: posix_spawn: add Cygwin-specific code fixing process synchronisation")
    Reported-by: Bruno Haible <bruno@clisp.org>
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

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:
 
 - 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=1674
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;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-19 19:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-19 19:09 [newlib-cygwin/main] Cygwin: posix_spawnp: don't fallback to sh Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).