summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-03-06 21:58:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:52:20 -0500
commit9862fabead2f82ed0864c5de0dfe4f3bda4db7f5 (patch)
tree6c1a1b4924edc82d712c300b851184051ff9fe80 /source4/lib/ldb/common
parenteec236c1f295ff4e60b4d88db440771a18e0a6e3 (diff)
downloadsamba-9862fabead2f82ed0864c5de0dfe4f3bda4db7f5.tar.gz
samba-9862fabead2f82ed0864c5de0dfe4f3bda4db7f5.tar.bz2
samba-9862fabead2f82ed0864c5de0dfe4f3bda4db7f5.zip
r13901: Backends need to be initialized even if there are no modules
(This used to be commit 8340ab26dd61d90242283d4e6a0db10f6f6467e2)
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r--source4/lib/ldb/common/ldb_modules.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c
index 53394e7047..5dab448a56 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -242,31 +242,32 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[])
talloc_free(res);
}
- if (modules == NULL) {
- ldb_debug(ldb, LDB_DEBUG_TRACE, "No modules specified for this database\n");
- return 0;
- }
-
- for (i = 0; modules[i] != NULL; i++) {
- struct ldb_module *current;
- const struct ldb_module_ops *ops;
+ if (modules != NULL) {
+ for (i = 0; modules[i] != NULL; i++) {
+ struct ldb_module *current;
+ const struct ldb_module_ops *ops;
- ops = ldb_find_module_ops(modules[i]);
- if (ops == NULL) {
- ldb_debug(ldb, LDB_DEBUG_WARNING, "WARNING: Module [%s] not found\n",
- modules[i]);
- continue;
- }
+ ops = ldb_find_module_ops(modules[i]);
+ if (ops == NULL) {
+ ldb_debug(ldb, LDB_DEBUG_WARNING, "WARNING: Module [%s] not found\n",
+ modules[i]);
+ continue;
+ }
- current = talloc_zero(ldb, struct ldb_module);
- if (current == NULL) {
- return -1;
- }
+ current = talloc_zero(ldb, struct ldb_module);
+ if (current == NULL) {
+ return -1;
+ }
- current->ldb = ldb;
- current->ops = ops;
+ current->ldb = ldb;
+ current->ops = ops;
- DLIST_ADD(ldb->modules, current);
+ DLIST_ADD(ldb->modules, current);
+ }
+
+ talloc_free(modules);
+ } else {
+ ldb_debug(ldb, LDB_DEBUG_TRACE, "No modules specified for this database\n");
}
module = ldb->modules;
@@ -280,7 +281,6 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[])
return -1;
}
- talloc_free(modules);
return 0;
}