From: Sergio Durigan Junior Date: Sat, 25 Sep 2021 21:27:23 +0000 (-0400) Subject: [PR gdb/28369] Use get_shell on gdb/ser-pipe.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=906e2b7664c5becfa3e10717a7d530e87fdab4ec;p=binutils-gdb.git [PR gdb/28369] Use get_shell on gdb/ser-pipe.c 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 --- 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 #include "gdbsupport/filestuff.h" +#include "gdbsupport/pathstuff.h" #include @@ -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); }