svn commit: samba r10570 - in branches/tmp/samba4-winsrepl: .
source/libcli/wrepl source/torture/nbt
metze at samba.org
metze at samba.org
Wed Sep 28 09:59:22 GMT 2005
Author: metze
Date: 2005-09-28 09:59:21 +0000 (Wed, 28 Sep 2005)
New Revision: 10570
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10570
Log:
r12994 at SERNOX (orig r10569): metze | 2005-09-28 11:58:58 +0200
add all info that we have to wrepl_name, as we need it for replication :-)
metze
Modified:
branches/tmp/samba4-winsrepl/
branches/tmp/samba4-winsrepl/source/libcli/wrepl/winsrepl.c
branches/tmp/samba4-winsrepl/source/libcli/wrepl/winsrepl.h
branches/tmp/samba4-winsrepl/source/torture/nbt/winsreplication.c
Changeset:
Property changes on: branches/tmp/samba4-winsrepl
___________________________________________________________________
Name: svk:merge
- 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/SAMBA_4_0:10566
3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba4:9495
a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11632
+ 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/SAMBA_4_0:10569
3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba4:9495
a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11632
Modified: branches/tmp/samba4-winsrepl/source/libcli/wrepl/winsrepl.c
===================================================================
--- branches/tmp/samba4-winsrepl/source/libcli/wrepl/winsrepl.c 2005-09-28 09:58:58 UTC (rev 10569)
+++ branches/tmp/samba4-winsrepl/source/libcli/wrepl/winsrepl.c 2005-09-28 09:59:21 UTC (rev 10570)
@@ -729,7 +729,7 @@
status = NT_STATUS_NO_MEMORY;
io->out.names = talloc_array(packet, struct wrepl_name, io->out.num_names);
- if (io->out.names == NULL) goto failed;
+ if (io->out.names == NULL) goto nomem;
/* convert the list of names and addresses to a sane format */
for (i=0;i<io->out.num_names;i++) {
@@ -739,6 +739,12 @@
wname->name, wname->name_len);
if (!NT_STATUS_IS_OK(status)) goto failed;
+ name->flags = wname->flags;
+ name->group_flag= wname->group_flag;
+ name->version_id= wname->id;
+ name->owner = talloc_strdup(io->out.names, io->in.partner.address);
+ if (name->owner == NULL) goto nomem;
+
/* trying to save 1 or 2 bytes on the wire isn't a good idea */
if (wname->flags & 2) {
int j;
@@ -747,7 +753,7 @@
name->addresses = talloc_array(io->out.names,
struct wrepl_address,
name->num_addresses);
- if (name->addresses == NULL) goto failed;
+ if (name->addresses == NULL) goto nomem;
for (j=0;j<name->num_addresses;j++) {
name->addresses[j].owner =
talloc_steal(name->addresses,
@@ -759,16 +765,19 @@
} else {
name->num_addresses = 1;
name->addresses = talloc(io->out.names, struct wrepl_address);
- if (name->addresses == NULL) goto failed;
- name->addresses[0].owner = io->in.partner.address;
+ if (name->addresses == NULL) goto nomem;
+ name->addresses[0].owner = talloc_strdup(name->addresses,io->in.partner.address);
+ if (name->addresses[0].owner == NULL) goto nomem;
name->addresses[0].address = talloc_steal(name->addresses,
wname->addresses.ip);
}
}
talloc_steal(mem_ctx, io->out.names);
- status = NT_STATUS_OK;
-
+ talloc_free(packet);
+ return NT_STATUS_OK;
+nomem:
+ status = NT_STATUS_NO_MEMORY;
failed:
talloc_free(packet);
return status;
Modified: branches/tmp/samba4-winsrepl/source/libcli/wrepl/winsrepl.h
===================================================================
--- branches/tmp/samba4-winsrepl/source/libcli/wrepl/winsrepl.h 2005-09-28 09:58:58 UTC (rev 10569)
+++ branches/tmp/samba4-winsrepl/source/libcli/wrepl/winsrepl.h 2005-09-28 09:59:21 UTC (rev 10570)
@@ -116,6 +116,10 @@
uint32_t num_names;
struct wrepl_name {
struct nbt_name name;
+ uint32_t flags;
+ uint32_t group_flag;
+ uint64_t version_id;
+ const char *owner;
uint32_t num_addresses;
struct wrepl_address {
const char *owner;
Modified: branches/tmp/samba4-winsrepl/source/torture/nbt/winsreplication.c
===================================================================
--- branches/tmp/samba4-winsrepl/source/torture/nbt/winsreplication.c 2005-09-28 09:58:58 UTC (rev 10569)
+++ branches/tmp/samba4-winsrepl/source/torture/nbt/winsreplication.c 2005-09-28 09:59:21 UTC (rev 10570)
@@ -147,9 +147,12 @@
int i;
printf("%s\n", nbt_name_string(mem_ctx, &name->name));
+ printf("\tFLAGS: 0x%08X G_FLAG: 0x%08X VERSION_ID: %llu\n",
+ name->flags, name->group_flag, name->version_id);
+ printf("\tOWNER: %-15s\n", name->owner);
for (i=0;i<name->num_addresses;i++) {
- printf("\t%s %s\n",
- name->addresses[i].owner, name->addresses[i].address);
+ printf("\tADDR: %-15s OWNER: %-15s\n",
+ name->addresses[i].address, name->addresses[i].owner);
}
}
More information about the samba-cvs
mailing list