From: Sergio Durigan Junior <sergiodj@sergiodj.net>
To: GDB Patches <gdb-patches@sourceware.org>
Cc: Sergio Durigan Junior <sergiodj@sergiodj.net>
Subject: [PATCH] [PR gdb/28369] Use get_shell on gdb/ser-pipe.c
Date: Sat, 25 Sep 2021 17:34:21 -0400 [thread overview]
Message-ID: <20210925213421.750832-1-sergiodj@sergiodj.net> (raw)
PR gdb/28369 reports that gdb/ser-pipe.c has an 'execl' function call
with a hard-coded "/bin/sh" as its argument. We've had 'get_shell'
for a while now, which is conscious about the SHELL environment and a
better alternative to always calling "/bin/sh".
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28369
---
gdb/ser-pipe.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gdb/ser-pipe.c b/gdb/ser-pipe.c
index cc72010ae46..257e0d4a107 100644
--- a/gdb/ser-pipe.c
+++ b/gdb/ser-pipe.c
@@ -30,6 +30,7 @@
#include "gdbsupport/gdb_sys_time.h"
#include <fcntl.h>
#include "gdbsupport/filestuff.h"
+#include "gdbsupport/pathstuff.h"
#include <signal.h>
@@ -122,7 +123,9 @@ pipe_open (struct serial *scb, const char *name)
}
close_most_fds ();
- execl ("/bin/sh", "sh", "-c", name, (char *) 0);
+
+ const char *shellfile = get_shell ();
+ execl (shellfile, shellfile, "-c", name, (char *) 0);
_exit (127);
}
--
2.33.0
next reply other threads:[~2021-09-25 21:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-25 21:34 Sergio Durigan Junior [this message]
2021-09-30 17:40 ` Tom Tromey
2021-09-30 22:20 ` Sergio Durigan Junior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210925213421.750832-1-sergiodj@sergiodj.net \
--to=sergiodj@sergiodj.net \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).