]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib/ldb: allow ldb_get_opaque(ldb, "backend_no_debug_connect")
authorStefan Metzmacher <metze@samba.org>
Thu, 6 Mar 2025 16:23:39 +0000 (17:23 +0100)
committerRalph Boehme <slow@samba.org>
Thu, 3 Apr 2025 09:36:31 +0000 (09:36 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
lib/ldb/common/ldb_modules.c

index 08d251f9bdd62f41b3d15ef00fa953971c70fcad..04f27e6918f8f44874cb8d4632721c8d6144de1d 100644 (file)
@@ -223,6 +223,12 @@ int ldb_module_connect_backend(struct ldb_context *ldb,
        ret = be->ops->connect_fn(ldb, url, ldb->flags, options, backend_module);
 
        if (ret != LDB_SUCCESS) {
+               const char *no_debug = ldb_get_opaque(ldb, "backend_no_debug_connect");
+
+               if (no_debug != NULL && no_debug[0] == '1') {
+                       return ret;
+               }
+
                ldb_debug(ldb, LDB_DEBUG_ERROR,
                          "Failed to connect to '%s' with backend '%s': %s", url, be->ops->name, ldb_errstring(ldb));
                return ret;