r20729: add a version number to struct dsdb_extended_replicated_objects
[mat/samba.git] / source4 / dsdb / samdb / ldb_modules / repl_meta_data.c
index 53fd46f11632243a82f014ba5ec0577dd7f0614a..d88ca5f05ea34fadaea1fc359201b957f238c93e 100644 (file)
@@ -1272,6 +1272,13 @@ static int replmd_extended_replicated_objects(struct ldb_module *module, struct
 
        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;
        }