diff options
author | Günther Deschner <gd@samba.org> | 2011-01-12 11:17:48 +0100 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2011-01-13 12:21:08 +0100 |
commit | 425753ebe3e85e1e7ea939937269c10bc5f7fd73 (patch) | |
tree | ee8eb905c2ff2b47214a54ffefb7f7e0b08a26dd /source3/lib/netapi/getdc.c | |
parent | f9ca6904a474e8c33532708977878940ad5696e0 (diff) | |
download | samba-425753ebe3e85e1e7ea939937269c10bc5f7fd73.tar.gz samba-425753ebe3e85e1e7ea939937269c10bc5f7fd73.tar.bz2 samba-425753ebe3e85e1e7ea939937269c10bc5f7fd73.zip |
s3-libnetapi: prefer dcerpc_netr_X functions.
Guenther
Signed-off-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/lib/netapi/getdc.c')
-rw-r--r-- | source3/lib/netapi/getdc.c | 22 |
1 files changed, 16 insertions, 6 deletions
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, |