summaryrefslogtreecommitdiff
path: root/lib/util/fault.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-10-04 10:47:46 +0200
committerStefan Metzmacher <metze@samba.org>2011-10-04 10:57:56 +0200
commitf2b795e9cf3ddb0f6bf0929bd0e423d39d6d239a (patch)
treedb8098fa04e9fc53afa18566683732d7059d0802 /lib/util/fault.c
parent1ff61f1223f36a7cfa7acfc9da500b2684e5282b (diff)
downloadsamba-f2b795e9cf3ddb0f6bf0929bd0e423d39d6d239a.tar.gz
samba-f2b795e9cf3ddb0f6bf0929bd0e423d39d6d239a.tar.bz2
samba-f2b795e9cf3ddb0f6bf0929bd0e423d39d6d239a.zip
lib/util: make sure panic action can attach a debugger on ubuntu (>=10.10)
By default user processes can't attach a debugger to a process. So explicitly allow that for all child processes, before calling the panic action script. metze
Diffstat (limited to 'lib/util/fault.c')
-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];