s4-dns: disable segfault handling in dlz_bind9
authorAndrew Tridgell <tridge@samba.org>
Tue, 21 Dec 2010 01:42:23 +0000 (12:42 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 21 Dec 2010 10:18:19 +0000 (11:18 +0100)
we don't want bind9 calling the Samba segv handler

lib/util/fault.c
lib/util/util.h
source4/dns_server/dlz_bind9.c

index bbb3190198f61092bab930433c605441afd4a780..256e55a85bc773e02a708f55cbb42e0885cfd898 100644 (file)
@@ -187,9 +187,10 @@ setup our fault handlers
 **/
 _PUBLIC_ void fault_setup(const char *pname)
 {
-       if (progname == NULL) {
-               progname = pname;
+       if (progname != NULL) {
+               return;
        }
+       progname = pname;
 #ifdef SIGSEGV
        CatchSignal(SIGSEGV, sig_fault);
 #endif
@@ -204,6 +205,15 @@ _PUBLIC_ void fault_setup(const char *pname)
 #endif
 }
 
+/**
+   disable setting up fault handlers
+**/
+_PUBLIC_ void fault_setup_disable(void)
+{
+       progname = "fault disabled";
+}
+
+
 /**
   register a fault handler. 
   Should only be called once in the execution of smbd.
index 0073aa90513b0baa1e0a66cd0afb1e89bdd98cfe..86bb3daace317e3042bfbffbc86a7bd8d37bfe24 100644 (file)
@@ -87,6 +87,7 @@ _PUBLIC_ _NORETURN_ void smb_panic(const char *why);
 setup our fault handlers
 **/
 _PUBLIC_ void fault_setup(const char *pname);
+_PUBLIC_ void fault_setup_disable(void);
 #endif
 
 /**
index dc4c4bcd1e11aa0c7b1e63b9950f24cab72e92b9..931f2f30b62e828af4ee9618e48626c392bd6d24 100644 (file)
@@ -413,6 +413,8 @@ static isc_result_t parse_options(struct dlz_bind9_data *state,
        struct poptOption **popt_options;
        int ret;
 
+       fault_setup_disable();
+
        popt_options = ldb_module_popt_options(state->samdb);
        (*popt_options) = long_options;