From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.sergiodj.net (mail.sergiodj.net [167.114.15.217]) by sourceware.org (Postfix) with ESMTPS id F19DD3858403 for ; Sat, 25 Sep 2021 21:34:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F19DD3858403 Received: from localhost (bras-base-toroon1016w-grc-33-76-64-54-140.dsl.bell.ca [76.64.54.140]) by mail.sergiodj.net (Postfix) with ESMTPSA id EC453A01BC; Sat, 25 Sep 2021 17:34:24 -0400 (EDT) From: Sergio Durigan Junior To: GDB Patches Cc: Sergio Durigan Junior Subject: [PATCH] [PR gdb/28369] Use get_shell on gdb/ser-pipe.c Date: Sat, 25 Sep 2021 17:34:21 -0400 Message-Id: <20210925213421.750832-1-sergiodj@sergiodj.net> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2021 21:34:27 -0000 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 #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); } -- 2.33.0