s4-kcc: a bit more debug info on repsFrom creation
authorAndrew Tridgell <tridge@samba.org>
Mon, 20 Sep 2010 04:48:35 +0000 (21:48 -0700)
committerAndrew Tridgell <tridge@samba.org>
Mon, 20 Sep 2010 22:27:45 +0000 (15:27 -0700)
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/dsdb/kcc/kcc_periodic.c

index a79c848567409ba35c6788ea61ef0a1835051391..c396912aa379278875488451288eac98790dff83 100644 (file)
@@ -73,7 +73,8 @@ static bool check_MasterNC(struct kccsrv_partition *p, struct repsFromToBlob *r,
                struct ldb_dn *dn;
 
                struct GUID id2 = samdb_result_guid(msg, "invocationID");
-               if (!GUID_equal(&invocation_id, &id2)) {
+               if (GUID_all_zero(&id2) ||
+                   !GUID_equal(&invocation_id, &id2)) {
                        continue;
                }
 
@@ -89,6 +90,9 @@ static bool check_MasterNC(struct kccsrv_partition *p, struct repsFromToBlob *r,
                        }
                        if (ldb_dn_compare(dn, p->dn) == 0) {
                                talloc_free(dn);
+                               DEBUG(5,("%s hasMasterNCs match on %s in %s\n",
+                                        r1->other_info->dns_name, ldb_dn_get_linearized(dn),
+                                        ldb_dn_get_linearized(msg->dn)));
                                return true;
                        }
                        talloc_free(dn);
@@ -183,6 +187,7 @@ static NTSTATUS kccsrv_add_repsFrom(struct kccsrv_service *s, TALLOC_CTX *mem_ct
                                old_reps[old_count] = reps[i];
                                old_count++;
                                modified = true;
+                               DEBUG(4,(__location__ ": Added repsFrom for %s\n", reps[i].ctr.ctr1.other_info->dns_name));
                        }
                }
 
@@ -194,6 +199,7 @@ static NTSTATUS kccsrv_add_repsFrom(struct kccsrv_service *s, TALLOC_CTX *mem_ct
                                old_count--;
                                i--;
                                modified = true;
+                               DEBUG(4,(__location__ ": Removed repsFrom for %s\n", reps[i].ctr.ctr1.other_info->dns_name));
                        }
                }