summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@sernet.de>2008-03-20 13:27:13 +0100
committerStefan Metzmacher <metze@samba.org>2009-01-19 07:05:51 +0100
commitbbe4785f342d6513fd001fdde94a945b2f2b654a (patch)
tree2160d50cee12e0d499a9a75f560a8327737eb978
parentc4402e3fde823a1984cc10f390d09c0ef9c8af0d (diff)
downloadsamba-bbe4785f342d6513fd001fdde94a945b2f2b654a.tar.gz
samba-bbe4785f342d6513fd001fdde94a945b2f2b654a.tar.bz2
samba-bbe4785f342d6513fd001fdde94a945b2f2b654a.zip
wrepl_server: fix the record expire time of sgroup merges
if we're the owner, the expire time becomes the highest expire time of owned addresses metze (from samba4wins tree 024f439db45046c7c0bb4759c75877462405baec)
-rw-r--r--source4/wrepl_server/wrepl_apply_records.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source4/wrepl_server/wrepl_apply_records.c b/source4/wrepl_server/wrepl_apply_records.c
index 17777f4dcf..6db093b619 100644
--- a/source4/wrepl_server/wrepl_apply_records.c
+++ b/source4/wrepl_server/wrepl_apply_records.c
@@ -1283,7 +1283,25 @@ static NTSTATUS r_do_sgroup_merge(struct wreplsrv_partner *partner,
* will be owner of the merge result, otherwise we take the ownership
*/
if (become_owner) {
+ time_t lh = 0;
+
modify_flags = WINSDB_FLAG_ALLOC_VERSION | WINSDB_FLAG_TAKE_OWNERSHIP;
+
+ /*
+ * if we're the owner, the expire time becomes the highest
+ * expire time of owned addresses
+ */
+ len = winsdb_addr_list_length(merge->addresses);
+
+ for (i=0; i < len; i++) {
+ if (strcmp(merge->addresses[i]->wins_owner, local_owner)==0) {
+ lh = MAX(lh, merge->addresses[i]->expire_time);
+ }
+ }
+
+ if (lh != 0) {
+ merge->expire_time = lh;
+ }
}
ret = winsdb_modify(partner->service->wins_db, merge, modify_flags);