summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_interface.c22
-rw-r--r--source3/passdb/pdb_ldap.c3
2 files changed, 22 insertions, 3 deletions
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
index ce8b46eb0f..976dfc1d08 100644
--- a/source3/passdb/pdb_interface.c
+++ b/source3/passdb/pdb_interface.c
@@ -94,6 +94,23 @@ struct pdb_init_function_entry *pdb_find_backend_entry(const char *name)
return NULL;
}
+/*
+ * The event context for the passdb backend. I know this is a bad hack and yet
+ * another static variable, but our pdb API is a global thing per
+ * definition. The first use for this is the LDAP idle function, more might be
+ * added later.
+ *
+ * I don't feel too bad about this static variable, it replaces the
+ * smb_idle_event_list that used to exist in lib/module.c. -- VL
+ */
+
+static struct event_context *pdb_event_ctx;
+
+struct event_context *pdb_get_event_context(void)
+{
+ return pdb_event_ctx;
+}
+
/******************************************************************
Make a pdb_methods from scratch
*******************************************************************/
@@ -1116,8 +1133,9 @@ BOOL pdb_new_rid(uint32 *rid)
If uninitialised, context will auto-init on first use.
***************************************************************/
-BOOL initialize_password_db(BOOL reload)
-{
+BOOL initialize_password_db(BOOL reload, struct event_context *event_ctx)
+{
+ pdb_event_ctx = event_ctx;
return (pdb_get_methods_reload(reload) != NULL);
}
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index c4c53c3066..7765eb3c20 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -5539,7 +5539,8 @@ static NTSTATUS pdb_init_ldapsam_common(struct pdb_methods **pdb_method, const c
return NT_STATUS_NO_MEMORY;
}
- nt_status = smbldap_init(*pdb_method, location, &ldap_state->smbldap_state);
+ nt_status = smbldap_init(*pdb_method, pdb_get_event_context(),
+ location, &ldap_state->smbldap_state);
if ( !NT_STATUS_IS_OK(nt_status) ) {
return nt_status;