summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-11-01 12:33:11 +1100
committerAndrew Tridgell <tridge@samba.org>2010-11-01 18:55:18 +1100
commitefdcedb6b16316450739a3a7da7de503ea5e0d04 (patch)
tree00bceb5be9664c9281b2c55e8a8c51463f71ab70 /source4
parent8b63ff52e2442d457b5221f51cb9e85e4b94e298 (diff)
downloadsamba-efdcedb6b16316450739a3a7da7de503ea5e0d04.tar.gz
samba-efdcedb6b16316450739a3a7da7de503ea5e0d04.tar.bz2
samba-efdcedb6b16316450739a3a7da7de503ea5e0d04.zip
s4-ldb: convert the ildap module to the new type of ldb module
this gets rid of the module aliases, which caused issues on some systems (eg. gentoo).
Diffstat (limited to 'source4')
-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: