svn commit: samba r9633 - in branches/SOC/SAMBA_4_0: .
source/lib/samba3
brad at samba.org
brad at samba.org
Fri Aug 26 04:56:10 GMT 2005
Author: brad
Date: 2005-08-26 04:56:09 +0000 (Fri, 26 Aug 2005)
New Revision: 9633
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9633
Log:
r9624 at buttercup: jelmer | 2005-08-25 16:57:56 -0600
Support writing wins.ldif
Modified:
branches/SOC/SAMBA_4_0/
branches/SOC/SAMBA_4_0/source/lib/samba3/upgrade.c
Changeset:
Property changes on: branches/SOC/SAMBA_4_0
___________________________________________________________________
Name: svk:merge
- 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/SAMBA_4_0:9623
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/SAMBA_4_0:9624
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/SAMBA_4_0:5616
d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/samba-SAMBA_4_0:5609
Modified: branches/SOC/SAMBA_4_0/source/lib/samba3/upgrade.c
===================================================================
--- branches/SOC/SAMBA_4_0/source/lib/samba3/upgrade.c 2005-08-26 04:55:59 UTC (rev 9632)
+++ branches/SOC/SAMBA_4_0/source/lib/samba3/upgrade.c 2005-08-26 04:56:09 UTC (rev 9633)
@@ -121,8 +121,29 @@
return -1;
}
-int samba3_upgrade_winsdb(struct samba3 *samba3, struct ldb_context *ctx, struct ldb_message ***msgs)
+int samba3_upgrade_winsdb(struct samba3 *samba3, struct ldb_context *ldb, struct ldb_message ***msgs)
{
- /* FIXME */
- return -1;
+ int i;
+ int count = 0;
+
+ for (i = 0; i < samba3->winsdb_count; i++) {
+ struct samba3_winsdb_entry *e = &samba3->winsdb_entries[i];
+ int j;
+ struct ldb_message *msg = msg_array_add(ldb, msgs, &count);
+
+ msg->dn = ldb_dn_string_compose(ldb, NULL, "type=%d,name=%s", e->type, e->name);
+
+ ldb_msg_add_string(ldb, msg, "name", e->name);
+ ldb_msg_add_fmt(ldb, msg, "type", "%d", e->type);
+ ldb_msg_add_string(ldb, msg, "objectClass", "wins");
+ ldb_msg_add_fmt(ldb, msg, "nbFlags", "%x", e->nb_flags);
+ ldb_msg_add_string(ldb, msg, "expires",
+ ldap_timestring(msg, e->ttl));
+
+ for (j = 0; j < e->ip_count; j++) {
+ ldb_msg_add_string(ldb, msg, "address", sys_inet_ntoa(e->ips[j]));
+ }
+ }
+
+ return count;
}
More information about the samba-cvs
mailing list