summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/ldb/ldb_ildap/ldb_ildap.c30
-rw-r--r--source4/lib/ldb/wscript4
2 files changed, 17 insertions, 17 deletions
diff --git a/source4/lib/ldb/ldb_ildap/ldb_ildap.c b/source4/lib/ldb/ldb_ildap/ldb_ildap.c
index dab5abf661..9ede379c81 100644
--- a/source4/lib/ldb/ldb_ildap/ldb_ildap.c
+++ b/source4/lib/ldb/ldb_ildap/ldb_ildap.c
@@ -862,18 +862,18 @@ failed:
return LDB_ERR_OPERATIONS_ERROR;
}
-_PUBLIC_ const struct ldb_backend_ops ldb_ldap_backend_ops = {
- .name = "ldap",
- .connect_fn = ildb_connect
-};
-
-_PUBLIC_ const struct ldb_backend_ops ldb_ldapi_backend_ops = {
- .name = "ldapi",
- .connect_fn = ildb_connect
-};
-
-_PUBLIC_ const struct ldb_backend_ops ldb_ldaps_backend_ops = {
- .name = "ldaps",
- .connect_fn = ildb_connect
-};
-
+/*
+ initialise the module
+ */
+_PUBLIC_ int ldb_ildap_init(const char *ldb_version)
+{
+ int ret, i;
+ const char *names[] = { "ldap", "ldaps", "ldapi", NULL };
+ for (i=0; names[i]; i++) {
+ ret = ldb_register_backend(names[i], ildb_connect);
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
+ }
+ return LDB_SUCCESS;
+}
diff --git a/source4/lib/ldb/wscript b/source4/lib/ldb/wscript
index 04671352bf..d7e0efeeb3 100644
--- a/source4/lib/ldb/wscript
+++ b/source4/lib/ldb/wscript
@@ -87,9 +87,9 @@ def build(bld):
if s4_build:
# this is only in the s4 build
bld.SAMBA_MODULE('ldb_ildap', 'ldb_ildap/ldb_ildap.c',
- init_function='LDB_BACKEND(ldapi),LDB_BACKEND(ldaps),LDB_BACKEND(ldap)',
+ init_function='ldb_ildap_init',
+ module_init_name='ldb_init_module',
deps='talloc cli-ldap CREDENTIALS auth_system_session',
- aliases='ldb_ldaps ldb_ldapi ldb_ldap',
internal_module=False,
subsystem='ldb')
else: