--- /dev/null
+--- gdb/main.c.orig 2005-04-08 18:21:50.000000000 -0400
++++ gdb/main.c 2005-04-08 18:41:15.000000000 -0400
+@@ -693,7 +693,7 @@
+
+ if (!homedir
+ || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
+- if (!inhibit_gdbinit)
++ if (!inhibit_gdbinit && (cwdbuf.st_uid == getuid()) && (!cwdbuf.st_mode & (S_IWOTH)))
+ {
+ catch_command_errors (source_command, gdbinit, 0, RETURN_MASK_ALL);
+ }