summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2010-09-20 13:49:19 +0930
committerJeremy Allison <jra@samba.org>2010-09-20 13:15:17 -0700
commitdc192787955542510724541cf23b4d8ed4cc99d4 (patch)
treecceb12761506b4c6411d82f6e37315a2fb6e2a1e /source3
parent2c9cb11f53cb6454c0941028f6c4339244f2af93 (diff)
downloadsamba-dc192787955542510724541cf23b4d8ed4cc99d4.tar.gz
samba-dc192787955542510724541cf23b4d8ed4cc99d4.tar.bz2
samba-dc192787955542510724541cf23b4d8ed4cc99d4.zip
Really enable core dumps in Linux
commit e1f1ce68e1f685400a8c68bcec14018e3d1fc29d Author: Rusty Russell <rusty@rustcorp.com.au> Date: Mon Sep 20 13:33:30 2010 +0930 source3: dump core on Linux, even after seteuid/etc. The "dumpable" flag is reset on every call to set*uid, so we need to reset it to 1 in the signal handler itself. This code dates back to commit ac01fda2b97b 6 years ago :( Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/fault.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/lib/fault.c b/source3/lib/fault.c
index 02e054b680..dd87ae1100 100644
--- a/source3/lib/fault.c
+++ b/source3/lib/fault.c
@@ -319,14 +319,6 @@ void dump_core_setup(const char *progname)
#endif
#endif
-#if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
- /* On Linux we lose the ability to dump core when we change our user
- * ID. We know how to dump core safely, so let's make sure we have our
- * dumpable flag set.
- */
- prctl(PR_SET_DUMPABLE, 1);
-#endif
-
/* FIXME: if we have a core-plus-pid facility, configurably set
* this up here.
*/
@@ -382,6 +374,14 @@ void dump_core_setup(const char *progname)
umask(~(0700));
dbgflush();
+#if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
+ /* On Linux we lose the ability to dump core when we change our user
+ * ID. We know how to dump core safely, so let's make sure we have our
+ * dumpable flag set.
+ */
+ prctl(PR_SET_DUMPABLE, 1);
+#endif
+
/* Ensure we don't have a signal handler for abort. */
#ifdef SIGABRT
CatchSignal(SIGABRT, SIG_DFL);