From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id xvwcNfWVT2GDZwAAWB0awg (envelope-from ) for ; Sat, 25 Sep 2021 17:34:45 -0400 Received: by simark.ca (Postfix, from userid 112) id C86411EE25; Sat, 25 Sep 2021 17:34:45 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0CD221EDF0 for ; Sat, 25 Sep 2021 17:34:45 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 60B053858426 for ; Sat, 25 Sep 2021 21:34:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60B053858426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1632605684; bh=vBiUkw4AlrYRYs0krPnkDkLjRDcyWtMKsFWJA7rrtdg=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=FePlJLa73ylsp4nR3oGKymIgNoliiQD6F6GPR92E2F+siyfAZAacLighJsKpeM0e8 eFYiKE85r3ItIi4A+J8yB9uswX6xHe4etTLij7ZXnFGWqPN+LTjrl4I/5RcailXo74 Jgtm5LmA4yi+dMNOHD6Hoj8J33lAi8Q0x7QWPKtE= 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) To: GDB Patches 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-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: , From: Sergio Durigan Junior via Gdb-patches Reply-To: Sergio Durigan Junior Cc: Sergio Durigan Junior Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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