Re: [PATCH 2/2] Try to initialize data-directory by first searching for "data-directory" in the same directory as the gdb binary

Joel Brobecker
2012-09-25T07:02:25Z

> That's not what I meant. I don't see how using absolute file names is
> safer than using file names computed from relative file names.

You're right - it's not a great deal safer than with relative file
names. At least there is only one directory from which GDB is
susceptible to attack. But the possibility still exists, and probably
a simple "string" program can find the right location.

The latest proposal of installing a copy of the share directory
at the location where GDB would look for them is fairly clever
that way, since it does not open a new door. And since it was proposed,
I know I've seen this approach used in other projects as well.

--
Joel