summaryrefslogtreecommitdiff
path: root/source3/lib/netapi/getdc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/netapi/getdc.c')
-rw-r--r--source3/lib/netapi/getdc.c22
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,