summaryrefslogtreecommitdiff
path: root/source4/nbt_server/wins
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-12-22 09:56:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:37 -0500
commit9f270fd1129d305cf1a459ddca9461727e78484c (patch)
tree43b298cfdf1c177817e2ffcea900f4505b3cea65 /source4/nbt_server/wins
parent0e77fdc0b9a0301f4f9e7148963ac504129d021a (diff)
downloadsamba-9f270fd1129d305cf1a459ddca9461727e78484c.tar.gz
samba-9f270fd1129d305cf1a459ddca9461727e78484c.tar.bz2
samba-9f270fd1129d305cf1a459ddca9461727e78484c.zip
r12429: make static records always active with a max expire time
metze (This used to be commit 387d680b6f7d3470841a3c0ad3963b0c14853e45)
Diffstat (limited to 'source4/nbt_server/wins')
-rw-r--r--source4/nbt_server/wins/winsdb.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c
index 8ed55dca1a..4cdcd592fc 100644
--- a/source4/nbt_server/wins/winsdb.c
+++ b/source4/nbt_server/wins/winsdb.c
@@ -496,6 +496,18 @@ NTSTATUS winsdb_record(struct ldb_message *msg, TALLOC_CTX *mem_ctx, struct wins
}
rec->addresses[i] = NULL;
+ if (rec->is_static) {
+ if (num_values < 1) {
+ status = NT_STATUS_INTERNAL_DB_CORRUPTION;
+ goto failed;
+ }
+ rec->state = WREPL_STATE_ACTIVE;
+ rec->expire_time = get_time_t_max();
+ for (i=0;rec->addresses[i];i++) {
+ rec->addresses[i]->expire_time = rec->expire_time;
+ }
+ }
+
*_rec = rec;
return NT_STATUS_OK;
failed:
@@ -517,6 +529,14 @@ struct ldb_message *winsdb_message(struct ldb_context *ldb,
struct ldb_message *msg = ldb_msg_new(mem_ctx);
if (msg == NULL) goto failed;
+ if (rec->is_static) {
+ rec->state = WREPL_STATE_ACTIVE;
+ rec->expire_time = get_time_t_max();
+ for (i=0;rec->addresses[i];i++) {
+ rec->addresses[i]->expire_time = rec->expire_time;
+ }
+ }
+
/* make sure we don't put in corrupted records */
addr_count = winsdb_addr_list_length(rec->addresses);
if (rec->state == WREPL_STATE_ACTIVE && addr_count == 0) {