summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-08-09 12:23:29 +0200
committerStefan Metzmacher <metze@samba.org>2011-08-12 12:39:05 +0200
commitdaf56768c6487dc94e6a337297d065a378fe237a (patch)
treea4c5c3883f072e431051bd70773af66f311f9d59 /source4
parent47fcbd71ae811eb479fe479f4526fe11c0fa86b6 (diff)
downloadsamba-daf56768c6487dc94e6a337297d065a378fe237a.tar.gz
samba-daf56768c6487dc94e6a337297d065a378fe237a.tar.bz2
samba-daf56768c6487dc94e6a337297d065a378fe237a.zip
s4:libnet_vampire: don't keep the replication state if DRSUAPI_DRS_CRITICAL_ONLY was used
In that case we have incomplete information and need to start from 0 in the next run. metze Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/libnet/libnet_vampire.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c
index 80b1a61b57..efbcd8af68 100644
--- a/source4/libnet/libnet_vampire.c
+++ b/source4/libnet/libnet_vampire.c
@@ -626,6 +626,7 @@ NTSTATUS libnet_vampire_cb_store_chunk(void *private_data,
struct drsuapi_DsReplicaLinkedAttribute *linked_attributes;
const struct drsuapi_DsReplicaCursor2CtrEx *uptodateness_vector;
struct dsdb_extended_replicated_objects *objs;
+ uint32_t req_replica_flags;
struct repsFromTo1 *s_dsa;
char *tmp_dns_name;
uint32_t i;
@@ -667,6 +668,35 @@ NTSTATUS libnet_vampire_cb_store_chunk(void *private_data,
return NT_STATUS_INVALID_PARAMETER;
}
+ switch (c->req_level) {
+ case 0:
+ /* none */
+ req_replica_flags = 0;
+ break;
+ case 5:
+ req_replica_flags = c->req5->replica_flags;
+ break;
+ case 8:
+ req_replica_flags = c->req8->replica_flags;
+ break;
+ case 10:
+ req_replica_flags = c->req10->replica_flags;
+ break;
+ default:
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
+ if (req_replica_flags & DRSUAPI_DRS_CRITICAL_ONLY) {
+ /*
+ * If we only replicate the critical objects
+ * we should not remember what we already
+ * got, as it is incomplete.
+ */
+ ZERO_STRUCT(s_dsa->highwatermark);
+ uptodateness_vector = NULL;
+ }
+
+ /* TODO: avoid hardcoded flags */
s_dsa->replica_flags = DRSUAPI_DRS_WRIT_REP
| DRSUAPI_DRS_INIT_SYNC
| DRSUAPI_DRS_PER_SYNC;