From bd7a474b1967423711ff93c0080ce0f89270e3f9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 20 Jun 2005 04:56:43 +0000 Subject: r7776: add a method for getting arbitrary opaque data into a ldb context, for use by backends. Currently only EventContext is used in this way. (This used to be commit 9fa21b245843371f7777682ee4e5b98e2925b4d0) --- source4/lib/ldb/ldb_ildap/ldb_ildap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source4/lib/ldb/ldb_ildap') diff --git a/source4/lib/ldb/ldb_ildap/ldb_ildap.c b/source4/lib/ldb/ldb_ildap/ldb_ildap.c index eefe80c919..b51139aa6f 100644 --- a/source4/lib/ldb/ldb_ildap/ldb_ildap.c +++ b/source4/lib/ldb/ldb_ildap/ldb_ildap.c @@ -398,7 +398,7 @@ int ildb_connect(struct ldb_context *ldb, const char *url, ildb->rootDSE = NULL; - ildb->ldap = ldap_new_connection(ildb, NULL); + ildb->ldap = ldap_new_connection(ildb, ldb_get_opaque(ldb, "EventContext")); if (!ildb->ldap) { ldb_oom(ldb); goto failed; @@ -421,7 +421,8 @@ int ildb_connect(struct ldb_context *ldb, const char *url, ldb->modules->private_data = ildb; ldb->modules->ops = &ildb_ops; - if (cmdline_credentials->username_obtained > CRED_GUESSED) { + if (cmdline_credentials != NULL && + cmdline_credentials->username_obtained > CRED_GUESSED) { status = ldap_bind_sasl(ildb->ldap, cmdline_credentials); if (!NT_STATUS_IS_OK(status)) { ldb_debug(ldb, LDB_DEBUG_ERROR, "Failed to bind - %s\n", -- cgit