schema debug...
authorStefan Metzmacher <metze@samba.org>
Thu, 25 Jul 2013 10:22:06 +0000 (12:22 +0200)
committerStefan Metzmacher <metze@samba.org>
Sun, 29 Jun 2014 21:45:25 +0000 (23:45 +0200)
source4/dsdb/repl/replicated_objects.c

index 78b3d75ae8d11595e1a0678033b3b4987521f5bf..b91696a32ab239d8193d01c277aa6e31e5226561 100644 (file)
@@ -617,6 +617,7 @@ WERROR dsdb_replicated_objects_convert(struct ldb_context *ldb,
        struct dsdb_extended_replicated_objects *out;
        const struct drsuapi_DsReplicaObjectListItemEx *cur;
        uint32_t i;
+       WERROR schema_status;
 
        out = talloc_zero(mem_ctx, struct dsdb_extended_replicated_objects);
        W_ERROR_HAVE_NO_MEMORY(out);
@@ -642,17 +643,27 @@ WERROR dsdb_replicated_objects_convert(struct ldb_context *ldb,
                return status;
        }
 
+       /*
+        * check for schema changes in case
+        * we are not replicating Schema NC
+        */
+       schema_status = dsdb_schema_info_cmp(schema, mapping_ctr);
+
        if (ldb_dn_compare(partition_dn, ldb_get_schema_basedn(ldb)) != 0) {
                /*
                 * check for schema changes in case
                 * we are not replicating Schema NC
                 */
-               status = dsdb_schema_info_cmp(schema, mapping_ctr);
-               if (!W_ERROR_IS_OK(status)) {
-                       DEBUG(1,("Remote schema has changed while replicating %s\n",
-                                partition_dn_str));
+               if (!W_ERROR_IS_OK(schema_status)) {
+                       DEBUG(1,("Remote schema has changed while replicating %s - %s\n",
+                                partition_dn_str, win_errstr(schema_status)));
                        talloc_free(out);
-                       return status;
+                       return schema_status;
+               }
+       } else {
+               if (!W_ERROR_IS_OK(schema_status)) {
+                       DEBUG(1,("Replicate changed schema from %s - %s\n",
+                                partition_dn_str, win_errstr(schema_status)));
                }
        }
 
@@ -699,6 +710,11 @@ WERROR dsdb_replicated_objects_convert(struct ldb_context *ldb,
        /* free pfm_remote, we won't need it anymore */
        talloc_free(pfm_remote);
 
+       if (!W_ERROR_IS_OK(schema_status)) {
+               DEBUG(1,(__location__ "... Replicate changed schema from %s - %s\n",
+                        partition_dn_str, win_errstr(schema_status)));
+       }
+
        *objects = out;
        return WERR_OK;
 }