Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Keith Seitz <keiths@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] .gdbinit security (revived) [incl doc]
Date: Sat, 20 Nov 2010 02:50:00 -0000	[thread overview]
Message-ID: <20101120025036.GC10712@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <4CE702E7.4050504@redhat.com>

On Sat, 20 Nov 2010 00:06:15 +0100, Keith Seitz wrote:
> --- cli/cli-cmds.h	2 May 2010 23:52:14 -0000	1.16
> +++ cli/cli-cmds.h	19 Nov 2010 22:38:54 -0000
> @@ -126,7 +126,8 @@ extern void source_script (char *, int);
>  /* Exported to objfiles.c.  */
>  
>  extern int find_and_open_script (const char *file, int search_path,
> -				 FILE **streamp, char **full_path);
> +				 FILE **streamp, char **full_path,
> +				 int from_tty);

./python/py-auto-load.c: In function ‘source_section_scripts’:
./python/py-auto-load.c:222:10: error: too few arguments to function ‘find_and_open_script’
./cli/cli-cmds.h:128:12: note: declared here


> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ testsuite/gdb.base/gdbinit.exp	19 Nov 2010 22:38:55 -0000

> +global GDB
> +global GDBFLAGS
> +global gdb_prompt
> +global gdb_spawn_id;

Redundant.


> +set env(HOME) [pwd]

Some other env vars from default_gdb_start are missing there.

At least TERM will fix up gdb.log:
	-^[[?1034hGNU gdb (GDB) 7.2.50.20101120-cvs^M
	+GNU gdb (GDB) 7.2.50.20101120-cvs^M

And there were some reason even for the others:
	set env(LC_CTYPE) C
	set env(INPUTRC) "/dev/null"
	set env(TERM) "vt100"


> +remote_exec build "rm .gdbinit"

Shouldn't be `rm -f' here?  (Also for `cp' and `chmod' below.)

This way it deletes src-shipped `gdb/testsuite/.gdbinit' when you run the test
in the src tree.


> +remote_exec build "cp $srcdir/$subdir/gdbinit.sample .gdbinit"


> +gdb_expect 360 {

I would prefer
	gdb_test_multiple "" testname
(and thus also dropping the "timeout" case)

> +    -re "warning: file .*\.gdbinit.* is untrusted.*Read file anyway\?.*" {

Backslashes should be doubled here in "..." to have the desired effect (and not
considered as a regex metacharacter).


> +gdb_expect 360 {

gdb_test_multiple again.


> +    -re "warning: file.*\.gdbinit.* is untrusted.*Read file anyway\?.*" {

Backslashes again.


> +        fail "trusted .gdbinit allowed."
> +    }
> +    -re ".*reading gdbinit.*$gdb_prompt $"     {

Redundant leading `.*'.



Thanks,
Jan


  reply	other threads:[~2010-11-20  2:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-19 23:10 Keith Seitz
2010-11-20  2:50 ` Jan Kratochvil [this message]
2010-11-23 17:15   ` Keith Seitz
2010-11-20  9:45 ` Eli Zaretskii
2010-11-23 18:31   ` Keith Seitz
2010-11-23 19:19     ` Eli Zaretskii
2010-11-23 23:19     ` Doug Evans
2010-11-30  0:23       ` Keith Seitz
2010-11-24 21:23     ` Jan Kratochvil
2010-11-24 21:27       ` Keith Seitz

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=20101120025036.GC10712@host0.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@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