svn commit: samba r19362 - in branches/SAMBA_4_0/source/lib/ldb: common ldb_ildap ldb_ldap ldb_sqlite3 ldb_tdb

tridge at samba.org tridge at samba.org
Tue Oct 17 01:21:03 GMT 2006


Author: tridge
Date: 2006-10-17 01:21:02 +0000 (Tue, 17 Oct 2006)
New Revision: 19362

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

Log:

- don't need to store the baseinfo message after cache load

- set better names on talloc structures in ldb modules, making leaks
  easier to track down

Modified:
   branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.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-10-17 01:18:47 UTC (rev 19361)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c	2006-10-17 01:21:02 UTC (rev 19362)
@@ -266,6 +266,7 @@
 		if (current == NULL) {
 			return LDB_ERR_OPERATIONS_ERROR;
 		}
+		talloc_set_name(current, "ldb_module: %s", module_list[i]);
 		
 		current->ldb = ldb;
 		current->ops = ops;

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c	2006-10-17 01:18:47 UTC (rev 19361)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c	2006-10-17 01:21:02 UTC (rev 19362)
@@ -776,6 +776,7 @@
 		talloc_free(ildb);
 		return -1;
 	}
+	talloc_set_name_const(*module, "ldb_ildap backend");
 	(*module)->ldb = ldb;
 	(*module)->prev = (*module)->next = NULL;
 	(*module)->private_data = ildb;

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c	2006-10-17 01:18:47 UTC (rev 19361)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c	2006-10-17 01:21:02 UTC (rev 19362)
@@ -822,6 +822,7 @@
 		talloc_free(lldb);
 		return -1;
 	}
+	talloc_set_name_const(*module, "ldb_ldap backend");
 	(*module)->ldb = ldb;
 	(*module)->prev = (*module)->next = NULL;
 	(*module)->private_data = lldb;

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/ldb_sqlite3.c	2006-10-17 01:18:47 UTC (rev 19361)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/ldb_sqlite3.c	2006-10-17 01:21:02 UTC (rev 19362)
@@ -2101,6 +2101,7 @@
 		ldb_oom(ldb);
 		goto failed;
 	}
+	talloc_set_name_const(*module, "ldb_sqlite3 backend");
 	(*module)->ldb = ldb;
 	(*module)->prev = (*module)->next = NULL;
 	(*module)->private_data = lsqlite3;

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c	2006-10-17 01:18:47 UTC (rev 19361)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c	2006-10-17 01:21:02 UTC (rev 19362)
@@ -1058,11 +1058,18 @@
 		talloc_free(ltdb);
 		return -1;
 	}
+	talloc_set_name_const(*module, "ldb_tdb backend");
 	(*module)->ldb = ldb;
 	(*module)->prev = (*module)->next = NULL;
 	(*module)->private_data = ltdb;
 	(*module)->ops = &ltdb_ops;
 
+	if (ltdb_cache_load(*module) != 0) {
+		talloc_free(*module);
+		talloc_free(ltdb);
+		return -1;
+	}
+
 	return 0;
 }
 



More information about the samba-cvs mailing list