public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] hurd: Fix spawni SPAWN_XFLAGS_TRY_SHELL with empty argv
@ 2020-12-26 15:40 Samuel Thibault
0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2020-12-26 15:40 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a39b95b975929f12359d4bc55f25bd88c3ec02c5
commit a39b95b975929f12359d4bc55f25bd88c3ec02c5
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Sat Dec 26 16:39:40 2020 +0100
hurd: Fix spawni SPAWN_XFLAGS_TRY_SHELL with empty argv
When argv is empty, we need to add the original script to be run on the
shell command line.
Diff:
---
sysdeps/mach/hurd/spawni.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sysdeps/mach/hurd/spawni.c b/sysdeps/mach/hurd/spawni.c
index 2aeed683fe..b511265044 100644
--- a/sysdeps/mach/hurd/spawni.c
+++ b/sysdeps/mach/hurd/spawni.c
@@ -842,7 +842,11 @@ __spawni (pid_t *pid, const char *file,
{
/* The file is accessible but it is not an executable file.
Invoke the shell to interpret it as a script. */
- err = __argz_insert (&args, &argslen, args, _PATH_BSHELL);
+ err = 0;
+ if (!argslen)
+ err = __argz_insert (&args, &argslen, args, relpath);
+ if (!err)
+ err = __argz_insert (&args, &argslen, args, _PATH_BSHELL);
if (!err)
err = child_lookup (_PATH_BSHELL, O_EXEC, 0, &execfile);
if (!err)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-12-26 15:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-26 15:40 [glibc] hurd: Fix spawni SPAWN_XFLAGS_TRY_SHELL with empty argv Samuel Thibault
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).