From efdcedb6b16316450739a3a7da7de503ea5e0d04 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 1 Nov 2010 12:33:11 +1100 Subject: 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). --- source4/lib/ldb/ldb_ildap/ldb_ildap.c | 30 +++++++++++++++--------------- source4/lib/ldb/wscript | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'source4/lib/ldb') 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: -- cgit