From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40591 invoked by alias); 29 Jul 2015 19:21:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 40580 invoked by uid 89); 29 Jul 2015 19:21:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 29 Jul 2015 19:21:01 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id AE9628EB44; Wed, 29 Jul 2015 19:21:00 +0000 (UTC) Received: from localhost (unused-10-15-17-51.yyz.redhat.com [10.15.17.51]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6TJKxmk014823 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 29 Jul 2015 15:21:00 -0400 From: Sergio Durigan Junior To: Pedro Alves Cc: Doug Evans , GDB Patches , Eli Zaretskii Subject: Re: [PATCH v3] Make sure GDB uses a valid shell when starting the inferior and to perform the "shell" command References: <1437761993-18758-1-git-send-email-sergiodj@redhat.com> <1437869674-7880-1-git-send-email-sergiodj@redhat.com> <874mkq4t58.fsf@redhat.com> <55B80C0A.5020205@redhat.com> X-URL: http://blog.sergiodj.net Date: Wed, 29 Jul 2015 19:21:00 -0000 In-Reply-To: <55B80C0A.5020205@redhat.com> (Pedro Alves's message of "Wed, 29 Jul 2015 00:11:06 +0100") Message-ID: <877fpiixd0.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00883.txt.bz2 On Tuesday, July 28 2015, Pedro Alves wrote: > I have to say that I'm a bit puzzled at the necessity of > performing any validity check upfront. The original idea was not only to check if the $SHELL is valid, but mostly make GDB react to this by using another shell instead (/bin/sh in this case). > The proposed commit log says: > >> It is known that GDB needs a valid shell to start the inferior and to >> offer the "shell" command to the user. This has recently been the >> cause of a problem on the MIPS buildslave, because $SHELL was set to >> /sbin/nologin and several tests were failing. The thread is here: >> >> > > But, all that confusion stems from the bogus error, which was meanwhile > fixed by: > > https://sourceware.org/ml/gdb-patches/2015-07/msg00705.html > > With that in place, the original error log would look like: > > 220-exec-run > &"Cannot exec /sbin/nologin > -c exec /mips/proj/build-compiler/upstream-testing/mipsswbrd048/GDB-testing/debian-mips-m64/build/gdb/testsuite/outputs/gdb.mi/mi-watch/mi-watch > .\n" > > which should have made the problem obvious. I'd hazard a guess > that even if that was: > > Cannot exec /opt/whatever/bin/someshell -c exec /mips/proj/build-compiler/upstream-testing/mipsswbrd048/GDB-testing/debian-mips-m64/build/gdb/testsuite/outputs/gdb.mi/mi-watch/mi-watch > > then the first think you'd do is try running that manually, and figure > out quickly what is wrong. Sure, the new error message makes things easier to figure out indeed. And on a second thought I also agree that using the fork mechanism to just be able to issue a warning to the user seems too much/too dangerous. To be completely honest I still prefer the first version of the patch, which made GDB react when $SHELL was set to something dubious like /sbin/nologin and choose a proper shell to start the inferior instead. However, I understand that this patch has caused a lot of bikeshed already, and has been "degraded" to "just warn the user" (which, as you pointed out, is indeed not very necessary anymore), so TBH I don't have the energy/time to keep hacking on it now. I appreciate all the feedback received! Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/