summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/util/fault.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/util/fault.c b/lib/util/fault.c
index ed7684aaf3..7fe081d285 100644
--- a/lib/util/fault.c
+++ b/lib/util/fault.c
@@ -116,6 +116,13 @@ static void smb_panic_default(const char *why)
{
int result;
+#if defined(HAVE_PRCTL) && defined(PR_SET_PTRACER)
+ /*
+ * Make sure all children can attach a debugger.
+ */
+ prctl(PR_SET_PTRACER, getpid(), 0, 0, 0);
+#endif
+
if (panic_action && *panic_action) {
char pidstr[20];
char cmdstring[200];