The branch, master has been updated via f5fde21 s4-socket: do not segfault if the socket is NULL via d95826c s4-join: Send ReplicaUpdateRefs at the end of the join via 3cdfcb9 s4-domain-join: do not add DFSR entries when joining, this should be done in the code handling DFSR replication via dba46ca s4-vampire: Fix the output of fetched object for the schema-dn from 4b67a10 Simplify handling of user add command.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit f5fde21ec15c7086311ed297601471b75f03c917 Author: Matthieu Patou <m...@matws.net> Date: Wed Oct 26 23:58:15 2011 +0200 s4-socket: do not segfault if the socket is NULL Autobuild-User: Matthieu Patou <m...@samba.org> Autobuild-Date: Tue Nov 1 19:02:52 CET 2011 on sn-devel-104 commit d95826c218413e4add17c70184bfee7e38de97ff Author: Matthieu Patou <m...@matws.net> Date: Tue Oct 25 20:16:38 2011 +0200 s4-join: Send ReplicaUpdateRefs at the end of the join commit 3cdfcb93949bcee15b489e089156eeca84f39483 Author: Matthieu Patou <m...@matws.net> Date: Sun Oct 23 22:27:08 2011 +0200 s4-domain-join: do not add DFSR entries when joining, this should be done in the code handling DFSR replication commit dba46ca771fcf1ba77db68f6436c6564e5a7e1b6 Author: Matthieu Patou <m...@matws.net> Date: Sun Oct 23 15:01:29 2011 +0200 s4-vampire: Fix the output of fetched object for the schema-dn ----------------------------------------------------------------------- Summary of changes: source4/lib/socket/socket.c | 3 +++ source4/libnet/libnet_vampire.c | 10 ++++++++-- source4/scripting/python/samba/join.py | 29 +++++++++++++++++++---------- 3 files changed, 30 insertions(+), 12 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/lib/socket/socket.c b/source4/lib/socket/socket.c index 2dbdaad..42eb53a 100644 --- a/source4/lib/socket/socket.c +++ b/source4/lib/socket/socket.c @@ -352,6 +352,9 @@ _PUBLIC_ struct tsocket_address *socket_address_to_tsocket_address(TALLOC_CTX *m struct tsocket_address *r; int ret; + if (!a) { + return NULL; + } if (a->sockaddr) { ret = tsocket_address_bsd_from_sockaddr(mem_ctx, a->sockaddr, diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c index ef531a4..a11c9cb 100644 --- a/source4/libnet/libnet_vampire.c +++ b/source4/libnet/libnet_vampire.c @@ -519,6 +519,7 @@ NTSTATUS libnet_vampire_cb_schema_chunk(void *private_data, WERROR status; const struct drsuapi_DsReplicaOIDMapping_Ctr *mapping_ctr; uint32_t nc_object_count; + uint32_t nc_total_received = 0; uint32_t object_count; struct drsuapi_DsReplicaObjectListItemEx *first_object; struct drsuapi_DsReplicaObjectListItemEx *cur; @@ -549,13 +550,18 @@ NTSTATUS libnet_vampire_cb_schema_chunk(void *private_data, return NT_STATUS_INVALID_PARAMETER; } + if (!s->schema_part.first_object) { + nc_total_received = object_count; + } else { + nc_total_received = s->schema_part.object_count + object_count; + } if (nc_object_count) { DEBUG(0,("Schema-DN[%s] objects[%u/%u] linked_values[%u/%u]\n", - c->partition->nc.dn, object_count, nc_object_count, + c->partition->nc.dn, nc_total_received, nc_object_count, linked_attributes_count, nc_linked_attributes_count)); } else { DEBUG(0,("Schema-DN[%s] objects[%u] linked_values[%u]\n", - c->partition->nc.dn, object_count, linked_attributes_count)); + c->partition->nc.dn, nc_total_received, linked_attributes_count)); } if (!s->self_made_schema) { diff --git a/source4/scripting/python/samba/join.py b/source4/scripting/python/samba/join.py index 6a8ac97..b01ac0c 100644 --- a/source4/scripting/python/samba/join.py +++ b/source4/scripting/python/samba/join.py @@ -30,7 +30,6 @@ from samba.credentials import Credentials, DONT_USE_KERBEROS from samba.provision import secretsdb_self_join, provision, provision_fill, FILL_DRS, FILL_SUBDOMAIN from samba.schema import Schema from samba.net import Net -from samba.dcerpc import security import logging import talloc import random @@ -471,15 +470,6 @@ class dc_join(object): "fromServer" : ctx.dc_ntds_dn} ctx.samdb.add(rec) - if ctx.topology_dn and ctx.acct_dn: - print "Adding %s" % ctx.topology_dn - rec = { - "dn" : ctx.topology_dn, - "objectclass" : "msDFSR-Member", - "msDFSR-ComputerReference" : ctx.acct_dn, - "serverReference" : ctx.ntds_dn} - ctx.samdb.add(rec) - if ctx.acct_dn: print "Adding SPNs to %s" % ctx.acct_dn m = ldb.Message() @@ -685,10 +675,29 @@ class dc_join(object): else: ctx.local_samdb.transaction_commit() + def send_DsReplicaUpdateRefs(ctx, dn): + r = drsuapi.DsReplicaUpdateRefsRequest1() + r.naming_context = drsuapi.DsReplicaObjectIdentifier() + r.naming_context.dn = str(dn) + r.naming_context.guid = misc.GUID("00000000-0000-0000-0000-000000000000") + r.naming_context.sid = security.dom_sid("S-0-0") + r.dest_dsa_guid = ctx.ntds_guid + r.dest_dsa_dns_name = "%s._msdcs.%s" % (str(ctx.ntds_guid), ctx.dnsforest) + r.options = drsuapi.DRSUAPI_DRS_ADD_REF | drsuapi.DRSUAPI_DRS_DEL_REF + if not ctx.RODC: + r.options |= drsuapi.DRSUAPI_DRS_WRIT_REP + + if ctx.drsuapi: + ctx.drsuapi.DsReplicaUpdateRefs(ctx.drsuapi_handle, 1, r) def join_finalise(ctx): '''finalise the join, mark us synchronised and setup secrets db''' + print "Sending DsReplicateUpdateRefs for all the partitions" + ctx.send_DsReplicaUpdateRefs(ctx.schema_dn) + ctx.send_DsReplicaUpdateRefs(ctx.config_dn) + ctx.send_DsReplicaUpdateRefs(ctx.base_dn) + print "Setting isSynchronized and dsServiceName" m = ldb.Message() m.dn = ldb.Dn(ctx.local_samdb, '@ROOTDSE') -- Samba Shared Repository