summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2005-09-08 01:05:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:03:33 -0500
commitac01fda2b97b416467866ea9303a22de778f02e6 (patch)
treed5d388bfaa7701828ce6d608b6e5d7a132cda53a /source3/smbd
parent378ebea94609aaf004317b1a9b42304a8718714b (diff)
downloadsamba-ac01fda2b97b416467866ea9303a22de778f02e6.tar.gz
samba-ac01fda2b97b416467866ea9303a22de778f02e6.tar.bz2
samba-ac01fda2b97b416467866ea9303a22de778f02e6.zip
r10068: Use prctl(PR_SET_DUMPABLE) to make sure we can always leave a good
looking corpse on Linux. (This used to be commit 7c97a1bcc34892d7bf697b9421ba8caf4061d9b5)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/server.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 4217d821f4..a10968749d 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -22,6 +22,10 @@
#include "includes.h"
+#ifdef HAVE_SYS_PRCTL_H
+#include <sys/prctl.h>
+#endif
+
static int am_parent = 1;
/* the last message the was processed */
@@ -915,6 +919,14 @@ void build_options(BOOL screen);
* everything after this point is run after the fork()
*/
+#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
+
/* Initialise the password backed before the global_sam_sid
to ensure that we fetch from ldap before we make a domain sid up */