svn commit: samba r20729 - in branches/SAMBA_4_0/source/dsdb: repl samdb samdb/ldb_modules

metze at samba.org metze at samba.org
Sat Jan 13 11:37:14 GMT 2007


Author: metze
Date: 2007-01-13 11:37:13 +0000 (Sat, 13 Jan 2007)
New Revision: 20729

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

Log:
add a version number to struct dsdb_extended_replicated_objects

metze
Modified:
   branches/SAMBA_4_0/source/dsdb/repl/replicated_objects.c
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/partition.c
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c
   branches/SAMBA_4_0/source/dsdb/samdb/samdb.h


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/repl/replicated_objects.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/repl/replicated_objects.c	2007-01-13 11:24:39 UTC (rev 20728)
+++ branches/SAMBA_4_0/source/dsdb/repl/replicated_objects.c	2007-01-13 11:37:13 UTC (rev 20729)
@@ -192,8 +192,9 @@
 
 	out = talloc_zero(mem_ctx, struct dsdb_extended_replicated_objects);
 	W_ERROR_HAVE_NO_MEMORY(out);
+	out->version		= DSDB_EXTENDED_REPLICATED_OBJECTS_VERSION;
 
-	out->partition_dn = ldb_dn_new(out, ldb, partition_dn);
+	out->partition_dn	= ldb_dn_new(out, ldb, partition_dn);
 	W_ERROR_HAVE_NO_MEMORY(out->partition_dn);
 
 	out->source_dsa		= source_dsa;

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-13 11:24:39 UTC (rev 20728)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/partition.c	2007-01-13 11:37:13 UTC (rev 20729)
@@ -571,9 +571,16 @@
 
 	ext = talloc_get_type(req->op.extended.data, struct dsdb_extended_replicated_objects);
 	if (!ext) {
-		return LDB_ERR_OTHER;
+		ldb_debug(module->ldb, LDB_DEBUG_FATAL, "partition_extended_replicated_objects: invalid extended data\n");
+		return LDB_ERR_PROTOCOL_ERROR;
 	}
 
+	if (ext->version != DSDB_EXTENDED_REPLICATED_OBJECTS_VERSION) {
+		ldb_debug(module->ldb, LDB_DEBUG_FATAL, "partition_extended_replicated_objects: extended data invalid version [%u != %u]\n",
+			  ext->version, DSDB_EXTENDED_REPLICATED_OBJECTS_VERSION);
+		return LDB_ERR_PROTOCOL_ERROR;
+	}
+
 	return partition_replicate(module, req, ext->partition_dn);
 }
 

Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c	2007-01-13 11:24:39 UTC (rev 20728)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c	2007-01-13 11:37:13 UTC (rev 20729)
@@ -1272,9 +1272,16 @@
 
 	objs = talloc_get_type(req->op.extended.data, struct dsdb_extended_replicated_objects);
 	if (!objs) {
+		ldb_debug(module->ldb, LDB_DEBUG_FATAL, "replmd_extended_replicated_objects: invalid extended data\n");
 		return LDB_ERR_PROTOCOL_ERROR;
 	}
 
+	if (objs->version != DSDB_EXTENDED_REPLICATED_OBJECTS_VERSION) {
+		ldb_debug(module->ldb, LDB_DEBUG_FATAL, "replmd_extended_replicated_objects: extended data invalid version [%u != %u]\n",
+			  objs->version, DSDB_EXTENDED_REPLICATED_OBJECTS_VERSION);
+		return LDB_ERR_PROTOCOL_ERROR;
+	}
+
 	ar = replmd_replicated_init_handle(module, req, objs);
 	if (!ar) {
 		return LDB_ERR_OPERATIONS_ERROR;

Modified: branches/SAMBA_4_0/source/dsdb/samdb/samdb.h
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/samdb.h	2007-01-13 11:24:39 UTC (rev 20728)
+++ branches/SAMBA_4_0/source/dsdb/samdb/samdb.h	2007-01-13 11:37:13 UTC (rev 20729)
@@ -44,6 +44,13 @@
 };
 
 struct dsdb_extended_replicated_objects {
+	/* 
+	 * this is the version of the dsdb_extended_replicated_objects
+	 * version 0: initial implementation
+	 */
+#define DSDB_EXTENDED_REPLICATED_OBJECTS_VERSION 0
+	uint32_t version;
+
 	struct ldb_dn *partition_dn;
 
 	const struct repsFromTo1 *source_dsa;



More information about the samba-cvs mailing list