svn commit: samba r13901 - in
branches/SAMBA_4_0/source/lib/ldb/common: .
idra at samba.org
idra at samba.org
Mon Mar 6 21:58:07 GMT 2006
Author: idra
Date: 2006-03-06 21:58:07 +0000 (Mon, 06 Mar 2006)
New Revision: 13901
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13901
Log:
Backends need to be initialized even if there are no modules
Modified:
branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c
Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c 2006-03-06 21:40:47 UTC (rev 13900)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c 2006-03-06 21:58:07 UTC (rev 13901)
@@ -242,31 +242,32 @@
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;
+
+ DLIST_ADD(ldb->modules, current);
}
- current->ldb = ldb;
- current->ops = ops;
-
- 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 @@
return -1;
}
- talloc_free(modules);
return 0;
}
More information about the samba-cvs
mailing list