From 7f9153f7e8a3a39d23b6b9c1336031f769dce923 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 6 Jul 2010 15:35:16 +1000 Subject: s4-ldb: added ldb_options_find() ldb_options_find() allows backends to find options in the options[] array passed to the connect operation. This will be used by the ldb_ldap bind code --- source4/lib/ldb/common/ldb_modules.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/lib/ldb/common/ldb_modules.c') diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c index 6e92fc510d..e4e2c1586d 100644 --- a/source4/lib/ldb/common/ldb_modules.c +++ b/source4/lib/ldb/common/ldb_modules.c @@ -397,6 +397,7 @@ int ldb_init_module_chain(struct ldb_context *ldb, struct ldb_module *module) int ldb_load_modules(struct ldb_context *ldb, const char *options[]) { + const char *modules_string; const char **modules = NULL; unsigned int i; int ret; @@ -409,10 +410,9 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[]) /* check if we have a custom module list passd as ldb option */ if (options) { - for (i = 0; options[i] != NULL; i++) { - if (strncmp(options[i], LDB_MODULE_PREFIX, LDB_MODULE_PREFIX_LEN) == 0) { - modules = ldb_modules_list_from_string(ldb, mem_ctx, &options[i][LDB_MODULE_PREFIX_LEN]); - } + modules_string = ldb_options_find(ldb, options, "modules"); + if (modules_string) { + modules = ldb_modules_list_from_string(ldb, mem_ctx, modules_string); } } -- cgit