svn commit: samba r12429 - in branches/SAMBA_4_0/source/nbt_server/wins: .

metze at samba.org metze at samba.org
Thu Dec 22 09:56:15 GMT 2005


Author: metze
Date: 2005-12-22 09:56:14 +0000 (Thu, 22 Dec 2005)
New Revision: 12429

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12429

Log:
make static records always active with a max expire time

metze
Modified:
   branches/SAMBA_4_0/source/nbt_server/wins/winsdb.c


Changeset:
Modified: branches/SAMBA_4_0/source/nbt_server/wins/winsdb.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/wins/winsdb.c	2005-12-22 09:37:21 UTC (rev 12428)
+++ branches/SAMBA_4_0/source/nbt_server/wins/winsdb.c	2005-12-22 09:56:14 UTC (rev 12429)
@@ -496,6 +496,18 @@
 	}
 	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 *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) {



More information about the samba-cvs mailing list