diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-11-01 12:37:35 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-11-01 18:55:19 +1100 |
commit | e8f0e3aca9f834c53933dd31316c0b928944b400 (patch) | |
tree | 382592d19aaadffa82aec2c94d6458b4f3d8c698 /source4 | |
parent | efdcedb6b16316450739a3a7da7de503ea5e0d04 (diff) | |
download | samba-e8f0e3aca9f834c53933dd31316c0b928944b400.tar.gz samba-e8f0e3aca9f834c53933dd31316c0b928944b400.tar.bz2 samba-e8f0e3aca9f834c53933dd31316c0b928944b400.zip |
s4-ldb: convert the openldap ldb backend to the new style of module
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/ldb/ldb_ldap/ldb_ldap.c | 29 | ||||
-rw-r--r-- | source4/lib/ldb/wscript | 5 |
2 files changed, 18 insertions, 16 deletions
diff --git a/source4/lib/ldb/ldb_ldap/ldb_ldap.c b/source4/lib/ldb/ldb_ldap/ldb_ldap.c index b83ca87c5c..5b8b2d7b7d 100644 --- a/source4/lib/ldb/ldb_ldap/ldb_ldap.c +++ b/source4/lib/ldb/ldb_ldap/ldb_ldap.c @@ -954,17 +954,18 @@ failed: return LDB_ERR_OPERATIONS_ERROR; } -const struct ldb_backend_ops ldb_ldap_backend_ops = { - .name = "ldap", - .connect_fn = lldb_connect -}; - -const struct ldb_backend_ops ldb_ldapi_backend_ops = { - .name = "ldapi", - .connect_fn = lldb_connect -}; - -const struct ldb_backend_ops ldb_ldaps_backend_ops = { - .name = "ldaps", - .connect_fn = lldb_connect -}; +/* + initialise the module + */ +int ldb_ldap_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], lldb_connect); + if (ret != LDB_SUCCESS) { + return ret; + } + } + return LDB_SUCCESS; +} diff --git a/source4/lib/ldb/wscript b/source4/lib/ldb/wscript index d7e0efeeb3..600f3001ab 100644 --- a/source4/lib/ldb/wscript +++ b/source4/lib/ldb/wscript @@ -1,7 +1,7 @@ #!/usr/bin/env python APPNAME = 'ldb' -VERSION = '0.9.17' +VERSION = '0.9.18' blddir = 'bin' @@ -95,7 +95,8 @@ def build(bld): else: # this is not included in the s4 build bld.SAMBA_MODULE('ldb_ldap', 'ldb_ldap/ldb_ldap.c', - init_function='LDB_BACKEND(ldapi),LDB_BACKEND(ldaps),LDB_BACKEND(ldap)', + init_function='ldb_ldap_init', + module_init_name='ldb_init_module', deps='talloc lber ldap', enabled=bld.env.ENABLE_LDAP_BACKEND, internal_module=False, |