Re: [PATCH v3] Make sure GDB uses a valid shell when starting the inferior and to perform the "shell" command

Eli Zaretskii
2015-07-26T15:04:33Z

> From: Sergio Durigan Junior <sergiodj@redhat.com>
> Cc: Eli Zaretskii <eliz@gnu.org>, Sergio Durigan Junior <sergiodj@redhat.com>
> Date: Sat, 25 Jul 2015 20:14:34 -0400
>
> I updated the documentation to reflect the new behavior, and created a
> testcase to exercise the code. This patch has been regression-tested
> on Fedora 22 x86_64.
>
> OK to apply?
>
> Changes from v2:
>
> - Rewrote "Valid Shell" section in the documentation to mention that
> the tests performed are not exhaustive. Included a small example
> to demonstrate what happens if the user tries to use /bin/ls as
> the $SHELL (a "valid shell", in theory).
>
> Changes from v1:
>
> - Using @pxref instead of @ref in the documentation
>
> - Don't run the testcase when the target is mingw, cygwin, or remote
>
> - Including /usr/sbin/nologin and /bin/false in the list of invalid
> shells
>
> gdb/ChangeLog:
> 2015-07-24 Sergio Durigan Junior <sergiodj@redhat.com>
>
> * cli/cli-cmds.c (shell_escape): Check if the selected shell is
> valid.
> * fork-child.c (check_startup_with_shell): New function.
> (fork_inferior): Move code to the new function above. Call it.
> * utils.c (valid_shell): New function.
> * utils.h (valid_shell): New prototype.
>
> gdb/doc/ChangeLog:
> 2015-07-24 Sergio Durigan Junior <sergiodj@redhat.com>
>
> * gdb.texinfo (Shell Commands): Mention that the shell needs to be
> valid; point to "Valid Shell" subsection.
> (Valid Shell): New subsection.
> (Starting your Program): Mention that the shell needs to be valid;
> point to "Valid Shell" subsection.
> (Your Program's Arguments): Likewise.
> (Your Program's Environment): Likewise.
>
> gdb/testsuite/ChangeLog:
> 2015-07-24 Sergio Durigan Junior <sergiodj@redhat.com>
>
> * gdb.base/invalid-shell.exp: New file.

OK for the documentation part.

Thanks.