summaryrefslogtreecommitdiff
path: root/source3/lib/fault.c
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2006-05-16 02:50:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:03 -0500
commit0ed76af63d25fe98fc0366708675a514a3c5bddb (patch)
treeb9be0ddf6f61f4e4842e1f6d977127d5702458b1 /source3/lib/fault.c
parent62f61caff4cb36070a0987bfccc679ade091f73b (diff)
downloadsamba-0ed76af63d25fe98fc0366708675a514a3c5bddb.tar.gz
samba-0ed76af63d25fe98fc0366708675a514a3c5bddb.tar.bz2
samba-0ed76af63d25fe98fc0366708675a514a3c5bddb.zip
r15631: Add a new option "enable core files". Administrators can use this to
disable automatic core file dumping. Core files are enabled by default. (This used to be commit b59189280057849b67ac65f31cec23b859e21c91)
Diffstat (limited to 'source3/lib/fault.c')
-rw-r--r--source3/lib/fault.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/lib/fault.c b/source3/lib/fault.c
index 8ae45f2435..dc8c276d02 100644
--- a/source3/lib/fault.c
+++ b/source3/lib/fault.c
@@ -151,6 +151,15 @@ void dump_core_setup(const char *progname)
void dump_core(void)
{
+ /* Note that even if core dumping has been disabled, we still set up
+ * the core path. This is to handle the case where core dumping is
+ * turned on in smb.conf and the relevant daemon is not restarted.
+ */
+ if (!lp_enable_core_files()) {
+ DEBUG(0, ("Exiting on internal error (core file administratively disabled\n"));
+ exit(1);
+ }
+
if (*corepath != '\0') {
/* The chdir might fail if we dump core before we finish
* processing the config file.