summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common/ldb_modules.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-07-06 15:35:16 +1000
committerAndrew Tridgell <tridge@samba.org>2010-07-07 17:26:03 +1000
commit7f9153f7e8a3a39d23b6b9c1336031f769dce923 (patch)
treef16a27a60dd25fa30cde7c89b5898e9df320acef /source4/lib/ldb/common/ldb_modules.c
parent85504ae6ff72204894ea7a856f0f36b44ad77fe2 (diff)
downloadsamba-7f9153f7e8a3a39d23b6b9c1336031f769dce923.tar.gz
samba-7f9153f7e8a3a39d23b6b9c1336031f769dce923.tar.bz2
samba-7f9153f7e8a3a39d23b6b9c1336031f769dce923.zip
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
Diffstat (limited to 'source4/lib/ldb/common/ldb_modules.c')
-rw-r--r--source4/lib/ldb/common/ldb_modules.c8
1 files changed, 4 insertions, 4 deletions
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);
}
}