source4/dsdb/repl/ schema first
authorStefan Metzmacher <metze@samba.org>
Thu, 25 Jul 2013 20:50:34 +0000 (22:50 +0200)
committerStefan Metzmacher <metze@samba.org>
Sun, 29 Jun 2014 21:45:25 +0000 (23:45 +0200)
source4/dsdb/repl/drepl_partitions.c
source4/dsdb/repl/drepl_service.h

index 8c85ef6f2588d04394754aa5c353b89cde3585c9..71b1e8f7b51c0b2e8486061a1b5bc69ef7cf23b9 100644 (file)
@@ -99,6 +99,10 @@ WERROR dreplsrv_load_partitions(struct dreplsrv_service *s)
                                p->rodc_replica = true;
                        }
 
+                       if (ldb_dn_compare(p->dn, ldb_get_schema_basedn(s->samdb)) == 0) {
+                               p->is_schema = true;
+                       }
+
                        /* Do not add partitions more than once */
                        found = false;
                        for (tp = s->partitions; tp; tp = tp->next) {
@@ -112,7 +116,11 @@ WERROR dreplsrv_load_partitions(struct dreplsrv_service *s)
                                continue;
                        }
 
-                       DLIST_ADD(s->partitions, p);
+                       if (p->is_schema) {
+                               DLIST_ADD(s->partitions, p);
+                       } else {
+                               DLIST_ADD_END(s->partitions, p, NULL);
+                       }
                        DEBUG(2, ("dreplsrv_partition[%s] loaded\n", ldb_dn_get_linearized(p->dn)));
                }
        }
index edba4c4a49b5c47b9fb124d6fe67b4603e495142..942427c41e7e6a537cbc8bc15c4082f95f0db30c 100644 (file)
@@ -108,6 +108,7 @@ struct dreplsrv_partition {
 
        bool partial_replica;
        bool rodc_replica;
+       bool is_schema;
 };
 
 typedef void (*dreplsrv_extended_callback_t)(struct dreplsrv_service *,