summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-12-06 12:25:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:28:55 -0500
commit496b65d59311bd0f2e266bd696f97780fa628e52 (patch)
treeaede6351cf1d0276f38472da37428e5141424b39 /source4
parent85497ed8cbfce296664316d573b800b75000bcbc (diff)
downloadsamba-496b65d59311bd0f2e266bd696f97780fa628e52.tar.gz
samba-496b65d59311bd0f2e266bd696f97780fa628e52.tar.bz2
samba-496b65d59311bd0f2e266bd696f97780fa628e52.zip
r20053: implement the DsBind on the 1st drsuapi connection
metze (This used to be commit f66f9c2150b36952ac56290db473167eab22ce97)
Diffstat (limited to 'source4')
-rw-r--r--source4/libnet/libnet_become_dc.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c
index 34022701d0..66a61f6396 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -887,6 +887,11 @@ static void becomeDC_drsuapi_connect_send(struct libnet_BecomeDC_state *s,
composite_continue(c, creq, recv_fn, s);
}
+static void becomeDC_drsuapi_bind_send(struct libnet_BecomeDC_state *s,
+ struct becomeDC_drsuapi *drsuapi,
+ void (*recv_fn)(struct rpc_request *req));
+static void becomeDC_drsuapi1_bind_recv(struct rpc_request *req);
+
static void becomeDC_drsuapi1_connect_recv(struct composite_context *req)
{
struct libnet_BecomeDC_state *s = talloc_get_type(req->async.private_data,
@@ -896,6 +901,40 @@ static void becomeDC_drsuapi1_connect_recv(struct composite_context *req)
c->status = dcerpc_pipe_connect_b_recv(req, s, &s->drsuapi1.pipe);
if (!composite_is_ok(c)) return;
+ becomeDC_drsuapi_bind_send(s, &s->drsuapi1, becomeDC_drsuapi1_bind_recv);
+}
+
+static void becomeDC_drsuapi_bind_send(struct libnet_BecomeDC_state *s,
+ struct becomeDC_drsuapi *drsuapi,
+ void (*recv_fn)(struct rpc_request *req))
+{
+ struct composite_context *c = s->creq;
+ struct rpc_request *req;
+
+ GUID_from_string(DRSUAPI_DS_BIND_GUID_W2K3, &drsuapi->bind_guid);
+
+ drsuapi->bind_r.in.bind_guid = &drsuapi->bind_guid;
+ drsuapi->bind_r.in.bind_info = NULL;
+ drsuapi->bind_r.out.bind_handle = &drsuapi->bind_handle;
+
+ req = dcerpc_drsuapi_DsBind_send(drsuapi->pipe, s, &drsuapi->bind_r);
+ composite_continue_rpc(c, req, recv_fn, s);
+}
+
+static void becomeDC_drsuapi1_bind_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;
+
+ c->status = dcerpc_ndr_request_recv(req);
+ if (!composite_is_ok(c)) return;
+
+ if (!W_ERROR_IS_OK(s->drsuapi1.bind_r.out.result)) {
+ composite_error(c, werror_to_ntstatus(s->drsuapi1.bind_r.out.result));
+ return;
+ }
+
becomeDC_connect_ldap2(s);
}