summaryrefslogtreecommitdiff
path: root/source3/lib/netapi/getdc.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2011-04-06 14:35:24 +0200
committerGünther Deschner <gd@samba.org>2011-04-12 12:20:43 +0200
commit3acd6bde58ecd68faf8200268cc674a71c57778d (patch)
treeacde763cb36c218c256c4f7a4462f6c80b6fdcab /source3/lib/netapi/getdc.c
parent0eece6202c94fdd180f266049e1a3712b9477dc6 (diff)
downloadsamba-3acd6bde58ecd68faf8200268cc674a71c57778d.tar.gz
samba-3acd6bde58ecd68faf8200268cc674a71c57778d.tar.bz2
samba-3acd6bde58ecd68faf8200268cc674a71c57778d.zip
s3-netapi: use libnetapi_get_binding_handle().
Guenther
Diffstat (limited to 'source3/lib/netapi/getdc.c')
-rw-r--r--source3/lib/netapi/getdc.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/source3/lib/netapi/getdc.c b/source3/lib/netapi/getdc.c
index fd5cdc220d..e753deacb0 100644
--- a/source3/lib/netapi/getdc.c
+++ b/source3/lib/netapi/getdc.c
@@ -40,20 +40,17 @@ WERROR NetGetDCName_l(struct libnetapi_ctx *ctx,
WERROR NetGetDCName_r(struct libnetapi_ctx *ctx,
struct NetGetDCName *r)
{
- struct rpc_pipe_client *pipe_cli = NULL;
NTSTATUS status;
WERROR werr;
struct dcerpc_binding_handle *b;
- werr = libnetapi_open_pipe(ctx, r->in.server_name,
- &ndr_table_netlogon.syntax_id,
- &pipe_cli);
+ werr = libnetapi_get_binding_handle(ctx, r->in.server_name,
+ &ndr_table_netlogon.syntax_id,
+ &b);
if (!W_ERROR_IS_OK(werr)) {
goto done;
}
- b = pipe_cli->binding_handle;
-
status = dcerpc_netr_GetDcName(b, talloc_tos(),
r->in.server_name,
r->in.domain_name,
@@ -83,20 +80,17 @@ WERROR NetGetAnyDCName_l(struct libnetapi_ctx *ctx,
WERROR NetGetAnyDCName_r(struct libnetapi_ctx *ctx,
struct NetGetAnyDCName *r)
{
- struct rpc_pipe_client *pipe_cli = NULL;
NTSTATUS status;
WERROR werr;
struct dcerpc_binding_handle *b;
- werr = libnetapi_open_pipe(ctx, r->in.server_name,
- &ndr_table_netlogon.syntax_id,
- &pipe_cli);
+ werr = libnetapi_get_binding_handle(ctx, r->in.server_name,
+ &ndr_table_netlogon.syntax_id,
+ &b);
if (!W_ERROR_IS_OK(werr)) {
goto done;
}
- b = pipe_cli->binding_handle;
-
status = dcerpc_netr_GetAnyDCName(b, talloc_tos(),
r->in.server_name,
r->in.domain_name,
@@ -148,18 +142,15 @@ WERROR DsGetDcName_r(struct libnetapi_ctx *ctx,
{
WERROR werr;
NTSTATUS status = NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND;
- struct rpc_pipe_client *pipe_cli = NULL;
struct dcerpc_binding_handle *b;
- werr = libnetapi_open_pipe(ctx, r->in.server_name,
- &ndr_table_netlogon.syntax_id,
- &pipe_cli);
+ werr = libnetapi_get_binding_handle(ctx, r->in.server_name,
+ &ndr_table_netlogon.syntax_id,
+ &b);
if (!W_ERROR_IS_OK(werr)) {
goto done;
}
- b = pipe_cli->binding_handle;
-
status = dcerpc_netr_DsRGetDCNameEx(b,
ctx,
r->in.server_name,