diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-12-08 18:13:49 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:29:02 -0500 |
commit | d26ac7b93718f3b24fa26a4534bfde1095cf7561 (patch) | |
tree | 24afdf12241d42cc9661463e4ab3959e871fa954 /source4/libnet | |
parent | 3155ded0481a69b5f8da6704f5076b2a4ee7ee70 (diff) | |
download | samba-d26ac7b93718f3b24fa26a4534bfde1095cf7561.tar.gz samba-d26ac7b93718f3b24fa26a4534bfde1095cf7561.tar.bz2 samba-d26ac7b93718f3b24fa26a4534bfde1095cf7561.zip |
r20084: pull the config partition
metze
(This used to be commit d770effb89a84b53fcdbe0ced29d76455321df9d)
Diffstat (limited to 'source4/libnet')
-rw-r--r-- | source4/libnet/libnet_become_dc.c | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c index 9dfb912b19..858c06555e 100644 --- a/source4/libnet/libnet_become_dc.c +++ b/source4/libnet/libnet_become_dc.c @@ -125,7 +125,7 @@ struct libnet_BecomeDC_state { struct drsuapi_DsReplicaObjectListItemEx *first_object; struct drsuapi_DsReplicaObjectListItemEx *last_object; - } schema; + } schema, config; struct becomeDC_fsmo { const char *dns_name; @@ -1693,6 +1693,8 @@ static void becomeDC_drsuapi3_pull_schema_send(struct libnet_BecomeDC_state *s) becomeDC_drsuapi3_pull_schema_recv); } +static void becomeDC_drsuapi3_pull_config_send(struct libnet_BecomeDC_state *s); + static void becomeDC_drsuapi3_pull_schema_recv(struct rpc_request *req) { struct libnet_BecomeDC_state *s = talloc_get_type(req->async.private, @@ -1719,6 +1721,56 @@ static void becomeDC_drsuapi3_pull_schema_recv(struct rpc_request *req) return; } + becomeDC_drsuapi3_pull_config_send(s); +} + +static void becomeDC_drsuapi3_pull_config_recv(struct rpc_request *req); + +static void becomeDC_drsuapi3_pull_config_send(struct libnet_BecomeDC_state *s) +{ + s->config.nc.guid = GUID_zero(); + s->config.nc.sid = s->zero_sid; + s->config.nc.dn = s->forest.config_dn_str; + + s->config.destination_dsa_guid = s->drsuapi2.bind_guid; + + s->config.replica_flags = DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE + | DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP + | DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS + | DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_IN_PROGRESS + | DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED + | DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES; + + becomeDC_drsuapi_pull_partition_send(s, &s->drsuapi2, &s->drsuapi3, &s->config, + becomeDC_drsuapi3_pull_config_recv); +} + +static void becomeDC_drsuapi3_pull_config_recv(struct rpc_request *req) +{ + struct libnet_BecomeDC_state *s = talloc_get_type(req->async.private, + struct libnet_BecomeDC_state); + struct composite_context *c = s->creq; + struct drsuapi_DsGetNCChanges *r = talloc_get_type(req->ndr.struct_ptr, + struct drsuapi_DsGetNCChanges); + WERROR status; + + c->status = dcerpc_ndr_request_recv(req); + if (!composite_is_ok(c)) return; + + status = becomeDC_drsuapi_pull_partition_recv(s, &s->config, r); + if (!W_ERROR_IS_OK(status)) { + composite_error(c, werror_to_ntstatus(status)); + return; + } + + talloc_free(r); + + if (s->config.highwatermark.tmp_highest_usn > s->config.highwatermark.highest_usn) { + becomeDC_drsuapi_pull_partition_send(s, &s->drsuapi2, &s->drsuapi3, &s->config, + becomeDC_drsuapi3_pull_config_recv); + return; + } + becomeDC_connect_ldap2(s); } |