This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch#2 6/6] Warn (but execute) local .gdbinit by default


Hi,

this patch could go in producing for 7.5:

$ ./gdb
warning: Reading file .gdbinit in current directory but it has been deprecated and the reading will be removed.  Use script associated with inferior executable
file instead.  See also 'set auto-load local-gdbinit'.  You may also use 'gdb -x .gdbinit ...'.

and in a GDB release or two releases later it gets turned into "warn-and-no":

$ ./gdb
warning: Ignoring file .gdbinit in current directory as it has been deprecated.  Use script associated with inferior executable file instead.  See also 'set
auto-load local-gdbinit'.  You may also use 'gdb -x .gdbinit ...'.

While at least in Fedora I would turn it to "warn-and-no" already (probably
only since F-18, though) as it is considered as a valid security issue.


Thanks,
Jan


gdb/
2012-03-20  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* auto-load.c (auto_load_local_gdbinit): Change it to
	auto_load_local_gdbinit_warn_and_yes.

gdb/doc/
2012-03-29  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.texinfo (Auto-loading): Update the expected output to
	warn-and-yes.

--- a/gdb/auto-load.c
+++ b/gdb/auto-load.c
@@ -110,7 +110,7 @@ static const char *const auto_load_local_gdbinit_enum[] =
 };
 
 /* Auto-load .gdbinit file from the current directory?  */
-const char *auto_load_local_gdbinit = auto_load_local_gdbinit_yes;
+const char *auto_load_local_gdbinit = auto_load_local_gdbinit_warn_and_yes;
 
 /* Absolute pathname to the current directory .gdbinit, if it exists.  */
 char *auto_load_local_gdbinit_pathname = NULL;
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -20731,7 +20731,7 @@ is enabled or disabled.
 (gdb) show auto-load
 gdb-scripts:  Canned sequences of commands auto-loading is on.
 libthread-db:  Inferior specific libthread_db auto-loading is on.
-local-gdbinit:  Current directory .gdbinit script auto-loading is yes.
+local-gdbinit:  Current directory .gdbinit script auto-loading is warn-and-yes.
 python-scripts:  Python scripts auto-loading is on.
 safe-path:  Directory list safe to hold auto-loaded files is /usr/local.
 @end smallexample


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]