]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix crash in DLZ plugin for incorrect setup
authorAlexander Bokovoy <ab@samba.org>
Fri, 19 Sep 2025 13:23:41 +0000 (16:23 +0300)
committerDouglas Bagnall <dbagnall@samba.org>
Sat, 20 Sep 2025 06:49:37 +0000 (06:49 +0000)
When bind is not yet setup properly, logging errors should be done
through the temporary handle.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15920

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Sat Sep 20 06:49:37 UTC 2025 on atb-devel-224

source4/dns_server/dlz_bind9.c

index e5c9679835e5ca50637dc35d48192243fafd7619..2a2430caba23794d057f336cbb261247fbf81a7e 100644 (file)
@@ -671,6 +671,9 @@ _PUBLIC_ isc_result_t dlz_create(const char *dlzname,
        }
        va_end(ap);
 
+       /* starting from here, we can only use state->log() until
+        * dlz_bind9_state is assigned */
+
        /* Do not install samba signal handlers */
        fault_setup_disable();
 
@@ -727,11 +730,11 @@ _PUBLIC_ isc_result_t dlz_create(const char *dlzname,
                }
 
                if (!file_exist(state->options.url)) {
-                       dlz_bind9_state->log(ISC_LOG_ERROR,
-                                            "samba_dlz: dlz_create could not find '%s'; "
-                                            "trying old location '%s/dns/sam.ldb' instead",
-                                            state->options.url,
-                                            lpcfg_private_dir(state->lp));
+                       state->log(ISC_LOG_ERROR,
+                                  "samba_dlz: dlz_create could not find '%s'; "
+                                  "trying old location '%s/dns/sam.ldb' instead",
+                                  state->options.url,
+                                  lpcfg_private_dir(state->lp));
                        state->options.url = talloc_asprintf(state,
                                                             "%s/dns/sam.ldb",
                                                             lpcfg_private_dir(state->lp));