summaryrefslogtreecommitdiffstats
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-03-05 21:59:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:10:57 -0500
commitec97506a51bf211409dedd6f14b5a40267879c94 (patch)
treec12d67d0c33911dcf5f53f93b7d4d85fb84daabc /source4/lib/ldb
parent75b3cfc17def4a5b49c7fbc4cfae1c85d12a3a11 (diff)
downloadsamba-ec97506a51bf211409dedd6f14b5a40267879c94.tar.gz
samba-ec97506a51bf211409dedd6f14b5a40267879c94.tar.xz
samba-ec97506a51bf211409dedd6f14b5a40267879c94.zip
r5664: simo, please look into this. It is possible for the number of elements
in msg[0] to be 0, in which case we crash. This is a workaround. Also, if you could please split up this function into readable pieces. It's a bit of a mess at the moment. (This used to be commit 19a22f78c28a4b265f59df1b43c1bb6c9e58f736)
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/common/ldb_modules.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c
index f8162aee8c7..ee70a639fa6 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -94,7 +94,7 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[])
char *modstr, *c, *p;
ret = ldb_search(ldb, "", LDB_SCOPE_BASE, "dn=@MODULES", attrs, &msg);
- if (ret == 0) {
+ if (ret == 0 || (ret == 1 && msg[0]->num_elements == 0)) {
ldb_debug(ldb, LDB_DEBUG_TRACE, "no modules required by the db\n");
} else {
if (ret < 0) {
@@ -184,6 +184,7 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[])
continue;
}
+#ifdef _SAMBA_BUILD_
if (strcmp(modules[i], "samldb") == 0) {
current = samldb_module_init(ldb, options);
if (!current) {
@@ -193,6 +194,7 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[])
DLIST_ADD(ldb->modules, current);
continue;
}
+#endif
#ifdef HAVE_DLOPEN_DISABLED
filename = talloc_asprintf(ldb, "%s.so", modules[i]);