This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Also install data-directory into the build directory as computed by relocate_gdb_directory
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: dje at google dot com, khooyp at cs dot umd dot edu, jan dot kratochvil at redhat dot com, gdb-patches at sourceware dot org
- Date: Thu, 04 Oct 2012 19:07:32 +0200
- Subject: Re: [PATCH] Also install data-directory into the build directory as computed by relocate_gdb_directory
- References: <2878953E-B698-43F3-989A-A551D96BAB62@cs.umd.edu> <20120924152641.GF4146@adacore.com> <9F52A338-A158-44DC-90C1-F46503859613@cs.umd.edu> <285502C6-1395-4049-9D55-031EDA3AD06D@cs.umd.edu> <20120924170348.GI4146@adacore.com> <CC9CEDC8-8941-43A8-88EA-DAB1B671DD32@cs.umd.edu> <20120927091737.GB2980@adacore.com> <CADPb22Q1a2TJ_bR0yq_wjOua8pBqBsZXvyS2uteX9xKiLuC9kw@mail.gmail.com> <20121004000840.GI3028@adacore.com> <83k3v69a1r.fsf@gnu.org> <20121004134927.GL3028@adacore.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Thu, 4 Oct 2012 06:49:28 -0700
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: dje@google.com, khooyp@cs.umd.edu, jan.kratochvil@redhat.com,
> gdb-patches@sourceware.org
>
> > Why not? Aren't there specific directories and/or files near the GDB
> > executable in this case?
>
> I have a feeling that this would open the door allowing attackers
> to setup GDB to execute unwanted code if we make it easy to reproduce
> the same environment and place GDB in a mode where it thinks it is
> inside a build directory.
Well, FWIW, Emacs uses a similar scheme (it tests for a couple of
files in specific directories around itself to decide whether it is
invoked without being installed), and I don't think anyone complained
about circumventions.
> But beyond this technical aspect, I am reluctant to add a mode to GDB
> that would then become useless to 99% of the people once GDB is properly
> installed. I don't think that the convenience it provides is important
> enough to justify it.
The question is: what's the price? If the price is sufficiently low,
I don't see why you should be reluctant, even if you are right and 99%
of users will find this useless. (FWIW, I almost always use GDB from
its build directory, I don't even know why.)