diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-10-05 07:51:51 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:20:34 -0500 |
commit | eb06c35f12f49c1ef003ed161cc0a2339453e452 (patch) | |
tree | c737b0ccb00dc281b3f8acc6fd0ecc3d536a9983 | |
parent | df31092a0171b1fee62138608294c2af3e4d0074 (diff) | |
download | samba-eb06c35f12f49c1ef003ed161cc0a2339453e452.tar.gz samba-eb06c35f12f49c1ef003ed161cc0a2339453e452.tar.bz2 samba-eb06c35f12f49c1ef003ed161cc0a2339453e452.zip |
r19092: active replica records cannot expire!
we handle that in the scavenging code, but were missing that
in the wins server name query code...
metze
(This used to be commit 7fb8dd3ab7a50b6fd77c74cb9078c62013b04a54)
-rw-r--r-- | source4/nbt_server/wins/winsdb.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c index e51b589f32..f423458073 100644 --- a/source4/nbt_server/wins/winsdb.c +++ b/source4/nbt_server/wins/winsdb.c @@ -618,6 +618,7 @@ NTSTATUS winsdb_record(struct winsdb_handle *h, struct ldb_message *msg, TALLOC_ struct ldb_message_element *el; struct nbt_name *name; uint32_t i, j, num_values; + BOOL we_are_owner = False; rec = talloc(mem_ctx, struct winsdb_record); if (rec == NULL) { @@ -678,10 +679,21 @@ NTSTATUS winsdb_record(struct winsdb_handle *h, struct ldb_message *msg, TALLOC_ goto failed; } - /* see if it has already expired */ + if (strcmp(rec->wins_owner, h->local_owner) == 0) { + we_are_owner = True; + } + + /* + * see if it has already expired + * + * NOTE: only expire owned records this way! + * w2k3 resolves expired replicas + * which are in active state + */ if (!rec->is_static && rec->expire_time <= now && - rec->state == WREPL_STATE_ACTIVE) { + rec->state == WREPL_STATE_ACTIVE && + we_are_owner) { DEBUG(5,("WINS: expiring name %s (expired at %s)\n", nbt_name_string(mem_ctx, rec->name), timestring(mem_ctx, rec->expire_time))); rec->state = WREPL_STATE_RELEASED; @@ -703,7 +715,8 @@ NTSTATUS winsdb_record(struct winsdb_handle *h, struct ldb_message *msg, TALLOC_ */ if (!rec->is_static && rec->addresses[j]->expire_time <= now && - rec->state == WREPL_STATE_ACTIVE) { + rec->state == WREPL_STATE_ACTIVE && + we_are_owner) { DEBUG(5,("WINS: expiring name addr %s of %s (expired at %s)\n", rec->addresses[j]->address, nbt_name_string(rec->addresses[j], rec->name), timestring(rec->addresses[j], rec->addresses[j]->expire_time))); |