From 425753ebe3e85e1e7ea939937269c10bc5f7fd73 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 12 Jan 2011 11:17:48 +0100 Subject: s3-libnetapi: prefer dcerpc_netr_X functions. Guenther Signed-off-by: Andreas Schneider --- source3/lib/netapi/getdc.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'source3/lib/netapi/getdc.c') diff --git a/source3/lib/netapi/getdc.c b/source3/lib/netapi/getdc.c index faf2672a14..fd5cdc220d 100644 --- a/source3/lib/netapi/getdc.c +++ b/source3/lib/netapi/getdc.c @@ -19,7 +19,7 @@ #include "includes.h" -#include "../librpc/gen_ndr/cli_netlogon.h" +#include "../librpc/gen_ndr/ndr_netlogon_c.h" #include "librpc/gen_ndr/libnetapi.h" #include "lib/netapi/netapi.h" #include "lib/netapi/netapi_private.h" @@ -43,6 +43,7 @@ WERROR NetGetDCName_r(struct libnetapi_ctx *ctx, 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, @@ -51,7 +52,9 @@ WERROR NetGetDCName_r(struct libnetapi_ctx *ctx, goto done; } - status = rpccli_netr_GetDcName(pipe_cli, talloc_tos(), + b = pipe_cli->binding_handle; + + status = dcerpc_netr_GetDcName(b, talloc_tos(), r->in.server_name, r->in.domain_name, (const char **)r->out.buffer, @@ -83,6 +86,7 @@ WERROR NetGetAnyDCName_r(struct libnetapi_ctx *ctx, 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, @@ -91,12 +95,15 @@ WERROR NetGetAnyDCName_r(struct libnetapi_ctx *ctx, goto done; } - status = rpccli_netr_GetAnyDCName(pipe_cli, talloc_tos(), + b = pipe_cli->binding_handle; + + status = dcerpc_netr_GetAnyDCName(b, talloc_tos(), r->in.server_name, r->in.domain_name, (const char **)r->out.buffer, &werr); if (!NT_STATUS_IS_OK(status)) { + werr = ntstatus_to_werror(status); goto done; } done: @@ -142,6 +149,7 @@ 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, @@ -150,7 +158,9 @@ WERROR DsGetDcName_r(struct libnetapi_ctx *ctx, goto done; } - status = rpccli_netr_DsRGetDCNameEx(pipe_cli, + b = pipe_cli->binding_handle; + + status = dcerpc_netr_DsRGetDCNameEx(b, ctx, r->in.server_name, r->in.domain_name, @@ -159,11 +169,11 @@ WERROR DsGetDcName_r(struct libnetapi_ctx *ctx, r->in.flags, (struct netr_DsRGetDCNameInfo **)r->out.dc_info, &werr); - if (NT_STATUS_IS_OK(status)) { + if (NT_STATUS_IS_OK(status) && W_ERROR_IS_OK(werr)) { goto done; } - status = rpccli_netr_DsRGetDCName(pipe_cli, + status = dcerpc_netr_DsRGetDCName(b, ctx, r->in.server_name, r->in.domain_name, -- cgit