svn commit: samba r5664 - in branches/SAMBA_4_0/source/lib/ldb/common: .

tridge at samba.org tridge at samba.org
Sat Mar 5 21:59:02 GMT 2005


Author: tridge
Date: 2005-03-05 21:59:02 +0000 (Sat, 05 Mar 2005)
New Revision: 5664

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5664

Log:
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.


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	2005-03-05 19:26:45 UTC (rev 5663)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c	2005-03-05 21:59:02 UTC (rev 5664)
@@ -94,7 +94,7 @@
 		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 @@
 				continue;
 			}
 
+#ifdef _SAMBA_BUILD_
 			if (strcmp(modules[i], "samldb") == 0) {
 				current = samldb_module_init(ldb, options);
 				if (!current) {
@@ -193,6 +194,7 @@
 				DLIST_ADD(ldb->modules, current);
 				continue;
 			}
+#endif
 
 #ifdef HAVE_DLOPEN_DISABLED
 			filename = talloc_asprintf(ldb, "%s.so", modules[i]);



More information about the samba-cvs mailing list