gdb/gdb-6.6-bz232371-selinux-thread-error.patch

18 lines
694 B
Diff
Raw Normal View History

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=232371
diff -u -rup gdb-6.6-orig/gdb/linux-nat.c gdb-6.6/gdb/linux-nat.c
--- gdb-6.6-orig/gdb/linux-nat.c 2007-03-15 19:55:40.000000000 -0400
+++ gdb-6.6/gdb/linux-nat.c 2007-03-15 20:02:09.000000000 -0400
@@ -1014,6 +1014,10 @@ lin_lwp_attach_lwp (ptid_t ptid, int ver
{
/* Try again with __WCLONE to check cloned processes. */
pid = my_waitpid (GET_LWP (ptid), &status, __WCLONE);
+ if (pid == -1 && errno == ECHILD)
+ error (_("Can't attach %s (%s) - possible SELinux denial,"
+ " check your /var/log/messages for `avc: denied'"),
+ target_pid_to_str (ptid), safe_strerror (errno));
lp->cloned = 1;
}