--- gdb/main.c.orig 2005-04-08 16:21:43.000000000 -0400 +++ gdb/main.c 2005-04-08 16:27:13.000000000 -0400 @@ -30,6 +30,7 @@ #include "getopt.h" +#include #include #include "gdb_stat.h" #include @@ -695,7 +696,11 @@ || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat))) if (!inhibit_gdbinit) { - catch_command_errors (source_command, gdbinit, 0, RETURN_MASK_ALL); + struct stat st; + if ((stat(gdbinit, &st)) != (-1)) { + if (st.st_uid == getuid()) + catch_command_errors (source_command, gdbinit, 0, RETURN_MASK_ALL); + } } for (i = 0; i < ncmd; i++)