summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-03-18 10:48:24 +0100
committerStefan Metzmacher <metze@samba.org>2010-03-18 12:39:43 +0100
commitfd86c9b6877ab9e416b82d04bc7cfc42af027d74 (patch)
treec67fbb5fdf56e6b22487d9c30fdb7e8254a56021
parent95cefcfa4a7da51f11c9662057275830b25555a4 (diff)
downloadsamba-fd86c9b6877ab9e416b82d04bc7cfc42af027d74.tar.gz
samba-fd86c9b6877ab9e416b82d04bc7cfc42af027d74.tar.bz2
samba-fd86c9b6877ab9e416b82d04bc7cfc42af027d74.zip
s4:utils/net/drs: make use of dcerpc_binding_handle stubs
metze
-rw-r--r--source4/utils/net/drs/net_drs.c6
-rw-r--r--source4/utils/net/drs/net_drs.h1
-rw-r--r--source4/utils/net/drs/net_drs_kcc.c2
-rw-r--r--source4/utils/net/drs/net_drs_replicate.c2
-rw-r--r--source4/utils/net/drs/net_drs_showrepl.c2
5 files changed, 8 insertions, 5 deletions
diff --git a/source4/utils/net/drs/net_drs.c b/source4/utils/net/drs/net_drs.c
index 0fd4781882..cd2f8dfcab 100644
--- a/source4/utils/net/drs/net_drs.c
+++ b/source4/utils/net/drs/net_drs.c
@@ -90,6 +90,7 @@ static bool net_drs_DsBind(struct net_drs_context *drs_ctx, struct net_drs_conne
d_printf("Failed to connect to server: %s\n", nt_errstr(status));
return false;
}
+ conn->drs_handle = conn->drs_pipe->binding_handle;
ZERO_STRUCT(in_bind_ctr);
in_bind_ctr.length = 48;
@@ -99,7 +100,7 @@ static bool net_drs_DsBind(struct net_drs_context *drs_ctx, struct net_drs_conne
req.in.bind_info = &in_bind_ctr;
req.out.bind_handle = &conn->bind_handle;
- status = dcerpc_drsuapi_DsBind(conn->drs_pipe, conn, &req);
+ status = dcerpc_drsuapi_DsBind_r(conn->drs_handle, conn, &req);
if (!NT_STATUS_IS_OK(status)) {
const char *errstr = nt_errstr(status);
if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
@@ -149,11 +150,12 @@ static bool net_drs_DsUnbind(struct net_drs_connection *conn)
r.out.bind_handle = &bind_handle;
r.in.bind_handle = &conn->bind_handle;
- dcerpc_drsuapi_DsUnbind(conn->drs_pipe, conn, &r);
+ dcerpc_drsuapi_DsUnbind_r(conn->drs_handle, conn, &r);
/* free dcerpc pipe in case we get called more than once */
talloc_free(conn->drs_pipe);
conn->drs_pipe = NULL;
+ conn->drs_handle = NULL;
return true;
}
diff --git a/source4/utils/net/drs/net_drs.h b/source4/utils/net/drs/net_drs.h
index dc5bb8c9d0..310bb06cde 100644
--- a/source4/utils/net/drs/net_drs.h
+++ b/source4/utils/net/drs/net_drs.h
@@ -50,6 +50,7 @@ struct net_drs_connection {
/* DRSUAPI connection context */
struct dcerpc_binding *binding;
struct dcerpc_pipe *drs_pipe;
+ struct dcerpc_binding_handle *drs_handle;
struct policy_handle bind_handle;
/* length of bind info structure returned by remote DC
diff --git a/source4/utils/net/drs/net_drs_kcc.c b/source4/utils/net/drs/net_drs_kcc.c
index 5b7c3cd06d..1afb96f517 100644
--- a/source4/utils/net/drs/net_drs_kcc.c
+++ b/source4/utils/net/drs/net_drs_kcc.c
@@ -140,7 +140,7 @@ int net_drs_kcc_cmd(struct net_context *ctx, int argc, const char **argv)
req.in.bind_handle = &drs_conn->bind_handle;
req.in.level = 1;
req.in.req = &kcc_req;
- status = dcerpc_drsuapi_DsExecuteKCC(drs_conn->drs_pipe, drs_ctx, &req);
+ status = dcerpc_drsuapi_DsExecuteKCC_r(drs_conn->drs_handle, drs_ctx, &req);
if (!NT_STATUS_IS_OK(status)) {
const char *errstr = nt_errstr(status);
if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
diff --git a/source4/utils/net/drs/net_drs_replicate.c b/source4/utils/net/drs/net_drs_replicate.c
index 6c6cbfaf97..147eb45e84 100644
--- a/source4/utils/net/drs/net_drs_replicate.c
+++ b/source4/utils/net/drs/net_drs_replicate.c
@@ -170,7 +170,7 @@ static bool net_drs_replicate_sync_nc(struct net_drs_context *drs_ctx,
req.in.req->req1.source_dsa_guid = ntds_guid_src;
/* send DsReplicaSync request */
- status = dcerpc_drsuapi_DsReplicaSync(drs_conn->drs_pipe, drs_ctx, &req);
+ status = dcerpc_drsuapi_DsReplicaSync_r(drs_conn->drs_handle, drs_ctx, &req);
if (!NT_STATUS_IS_OK(status)) {
const char *errstr = nt_errstr(status);
if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
diff --git a/source4/utils/net/drs/net_drs_showrepl.c b/source4/utils/net/drs/net_drs_showrepl.c
index a8dcf99c35..33fb014b91 100644
--- a/source4/utils/net/drs/net_drs_showrepl.c
+++ b/source4/utils/net/drs/net_drs_showrepl.c
@@ -213,7 +213,7 @@ static bool net_drs_exec_DsReplicaGetInfo(struct net_drs_context *drs_ctx,
r.out.info = _replica_info;
r.out.info_type = &info_type_got;
- status = dcerpc_drsuapi_DsReplicaGetInfo(drs_conn->drs_pipe, drs_ctx, &r);
+ status = dcerpc_drsuapi_DsReplicaGetInfo_r(drs_conn->drs_handle, drs_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
const char *errstr = nt_errstr(status);
if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {