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

metze at samba.org metze at samba.org
Fri Oct 14 12:49:41 GMT 2005


Author: metze
Date: 2005-10-14 12:49:36 +0000 (Fri, 14 Oct 2005)
New Revision: 11025

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

Log:
 r10313 at SERNOX:  metze | 2005-09-19 12:19:27 +0200
 add wrapper functions for the "address" attribute in the winsdb,
 the goal is to store the expiry time and the wins owner per address,
 which is needed for wins replication
 
 metze

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


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: svk:merge
   - 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/tmp/samba4-winsrepl:10311
3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba4:9495
a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11632
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/SAMBA_4_0:5616
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/samba-SAMBA_4_0:5609
   + 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/tmp/samba4-winsrepl:10313
3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba4:9495
a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11632
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/SAMBA_4_0:5616
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/samba-SAMBA_4_0:5609

Modified: branches/SAMBA_4_0/source/nbt_server/wins/winsdb.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/wins/winsdb.c	2005-10-14 12:48:34 UTC (rev 11024)
+++ branches/SAMBA_4_0/source/nbt_server/wins/winsdb.c	2005-10-14 12:49:36 UTC (rev 11025)
@@ -119,6 +119,24 @@
 	return dn;
 }
 
+static const char *winsdb_addr_decode(TALLOC_CTX *mem_ctx, struct ldb_val *val)
+{
+	const char *addr;
+	addr = talloc_steal(mem_ctx, val->data);
+	return addr;
+}
+
+static int ldb_msg_add_winsdb_addr(struct ldb_context *ldb, struct ldb_message *msg, 
+				   const char *attr_name, const char *addr)
+{
+	struct ldb_val val;
+
+	val.data = discard_const_p(uint8_t, addr);
+	val.length = strlen(addr);
+
+	return ldb_msg_add_value(ldb, msg, attr_name, &val);
+}
+
 /*
   load a WINS entry from the database
 */
@@ -159,7 +177,8 @@
 	if (rec->addresses == NULL) goto failed;
 
 	for (i=0;i<el->num_values;i++) {
-		rec->addresses[i] = talloc_steal(rec->addresses, el->values[i].data);
+		rec->addresses[i] = winsdb_addr_decode(rec->addresses, &el->values[i]);
+		if (rec->addresses[i] == NULL) goto failed;
 	}
 	rec->addresses[i] = NULL;
 



More information about the samba-cvs mailing list