svn commit: samba r20849 - in branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules: .

metze at samba.org metze at samba.org
Wed Jan 17 14:19:06 GMT 2007


Author: metze
Date: 2007-01-17 14:19:06 +0000 (Wed, 17 Jan 2007)
New Revision: 20849

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

Log:
first step to move away from using find_backend() and use find_partition()
instead

metze
Modified:
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/partition.c


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/partition.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/partition.c	2007-01-17 14:09:14 UTC (rev 20848)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/partition.c	2007-01-17 14:19:06 UTC (rev 20849)
@@ -138,7 +138,6 @@
 	return make_module_for_next_request(req, module->ldb, partition->module);
 };
 
-
 /*
   fire the caller's callback for every entry, but only send 'done' once.
 */
@@ -274,6 +273,7 @@
 static int partition_replicate(struct ldb_module *module, struct ldb_request *req, struct ldb_dn *dn) 
 {
 	int i;
+	struct dsdb_control_current_partition *partition;
 	struct ldb_module *backend;
 	struct partition_private_data *data = talloc_get_type(module->private_data, 
 							      struct partition_private_data);
@@ -293,11 +293,26 @@
 		}
 	}
 
-	/* Otherwise, we need to find the backend to fire it to */
+	/* Otherwise, we need to find the partition to fire it to */
 
-	/* Find backend */
-	backend = find_backend(module, req, dn);
-	
+	/* Find partition */
+	partition = find_partition(data, dn);
+	if (!partition) {
+		/*
+		 * if we haven't found a matching partition
+		 * pass the request to the main ldb
+		 *
+		 * TODO: we should maybe return an error here
+		 *       if it's not a special dn
+		 */
+		return ldb_next_request(module, req);
+	}
+
+	backend = make_module_for_next_request(req, module->ldb, partition->module);
+	if (!backend) {
+		return LDB_ERR_OPERATIONS_ERROR;
+	}
+
 	/* issue request */
 	return ldb_next_request(backend, req);
 	



More information about the samba-cvs mailing list