From: Pedro Alves <palves@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Tom Tromey <tromey@redhat.com>, Doug Evans <dje@google.com>,
gdb-patches@sourceware.org
Subject: Re: [patch] New set auto-load-local-gdbinit + disable it by default
Date: Tue, 17 Jan 2012 20:56:00 -0000 [thread overview]
Message-ID: <4F15DFF8.8000707@redhat.com> (raw)
In-Reply-To: <20120117203235.GA19481@host2.jankratochvil.net>
On 01/17/2012 08:32 PM, Jan Kratochvil wrote:
> On Tue, 17 Jan 2012 21:21:42 +0100, Pedro Alves wrote:
>> Having to request a safe mode with an extra flag is a flawed design, IMO.
>> New, and non-aware-of-the-issues-implied (read, most) users, will just
>> not know about it, and will therefore not use it.
>
> I agree with it. I am thinking about it for more days already. But I have
> not found a way out.
>
> The problem is to differentiate these two cases:
> (a) as regular user:
> $ tar xzf foreign-crash.tar.gz; cd foreign-crash
> $ gdb crashprog crashcore # *-gdb.py files lay here around
> - You are 0wn3d!
Make gdb warn about files that could be autoloaded, but don't load them:
$ gdb crashprog crashcore # *-gdb.py files lay here around
security warning: found possibly unsafe files that could be autoloaded
foo-gdb.py
bar-gdb.py
Start gdb with the -superman option to load them automatically.
*debug core as usual*
(gdb)
There's probably a better spelling for that option... System/package/distro
.py files (printers, and stuff) would be trusted. The mechanism for that
could be path list based.
> (b) as regular user:
> $ cd my/great/project; make
> # gdb myprog-using-local-new-gdb.py-pretty-printers
$ cd my/great/project; make
# gdb -trustothers myprog-using-local-new-gdb.py-pretty-printers
Or the equivalent in ~/.gdbinit -- trustothers-ness possibly enabled with python
(checking for example, if the executable is under a /home/me/myprojects/
directory, or whatever other policy one prefers). If you forget to specify
the flag, gdb will warn you about the files that could be loaded.
The question is: is this too much inconvenience? I am willing to give it
a try for a while.
>
> If we want to fix (a) by default we have to regress (b) in the default case.
>
> The second question would be which directories are safe and which are not but
> that can be solved by some configuration variable and site-adjustable value.
Yes, agreed.
--
Pedro Alves
next prev parent reply other threads:[~2012-01-17 20:54 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-17 10:16 Jan Kratochvil
2012-01-17 12:34 ` Eli Zaretskii
2012-01-17 13:42 ` Joel Brobecker
2012-01-17 14:49 ` [patch 7.4] Deprecate local .gdbinit [Re: [patch] New set auto-load-local-gdbinit + disable it by default] Jan Kratochvil
2012-01-17 16:22 ` Doug Evans
2012-01-17 20:22 ` [patch] New set auto-load-local-gdbinit + disable it by default Tom Tromey
2012-01-17 16:15 ` Doug Evans
2012-01-17 16:34 ` Jan Kratochvil
2012-01-17 16:48 ` Doug Evans
2012-01-17 17:27 ` Jan Kratochvil
2012-01-17 17:33 ` Doug Evans
2012-01-17 17:55 ` Jan Kratochvil
2012-01-17 18:29 ` Eli Zaretskii
2012-01-17 18:35 ` Jan Kratochvil
2012-01-17 19:54 ` Tom Tromey
2012-01-17 18:31 ` Doug Evans
2012-01-17 18:44 ` Jan Kratochvil
2012-01-17 19:12 ` Doug Evans
2012-01-17 19:20 ` Jan Kratochvil
2012-01-17 19:55 ` Tom Tromey
2012-01-17 20:24 ` Pedro Alves
2012-01-17 20:26 ` Tom Tromey
2012-01-17 20:35 ` Jan Kratochvil
2012-01-17 20:56 ` Pedro Alves [this message]
2012-01-17 19:30 ` Matt Rice
2012-01-17 19:37 ` Jan Kratochvil
2012-01-17 20:26 ` Tom Tromey
2012-01-17 18:00 ` Eli Zaretskii
2012-01-17 18:28 ` Jan Kratochvil
2012-01-17 18:43 ` Eli Zaretskii
2012-01-17 19:02 ` Jan Kratochvil
2012-01-17 20:29 ` Tom Tromey
2012-01-17 20:49 ` Jan Kratochvil
2012-01-17 20:54 ` Doug Evans
2012-01-17 21:10 ` Tom Tromey
2012-01-17 21:13 ` Eli Zaretskii
2012-01-17 21:14 ` Tom Tromey
2012-01-18 4:26 ` Joel Brobecker
2012-01-18 19:38 ` Jan Kratochvil
2012-01-18 20:01 ` Doug Evans
2012-01-19 6:30 ` Joel Brobecker
2012-01-19 12:57 ` [commit] rm gdb/testsuite/.gdbinit [Re: [patch] New set auto-load-local-gdbinit + disable it by default] Jan Kratochvil
2012-01-19 21:07 ` [patch] New set auto-load-local-gdbinit + disable it by default Tom Tromey
2012-01-19 21:47 ` Jan Kratochvil
2012-01-19 21:53 ` Doug Evans
2012-01-20 4:11 ` Jan Kratochvil
2012-01-19 21:06 ` Tom Tromey
2012-01-17 22:16 ` Doug Evans
2012-01-18 3:05 ` Tom Tromey
2012-01-17 16:26 ` Matt Rice
2012-01-17 16:57 ` Doug Evans
2012-01-17 20:09 ` Tom Tromey
2012-01-24 0:33 ` Stan Shebs
2012-01-24 15:54 ` Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F15DFF8.8000707@redhat.com \
--to=palves@redhat.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox