diff options
Diffstat (limited to 'source3/lib/netapi/netlogon.c')
-rw-r--r-- | source3/lib/netapi/netlogon.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/source3/lib/netapi/netlogon.c b/source3/lib/netapi/netlogon.c index 8c30d6caab..0a15063ba4 100644 --- a/source3/lib/netapi/netlogon.c +++ b/source3/lib/netapi/netlogon.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" @@ -131,6 +131,7 @@ WERROR I_NetLogonControl_r(struct libnetapi_ctx *ctx, NTSTATUS status; struct rpc_pipe_client *pipe_cli = NULL; union netr_CONTROL_QUERY_INFORMATION query; + struct dcerpc_binding_handle *b; werr = libnetapi_open_pipe(ctx, r->in.server_name, &ndr_table_netlogon.syntax_id, @@ -139,7 +140,9 @@ WERROR I_NetLogonControl_r(struct libnetapi_ctx *ctx, goto done; } - status = rpccli_netr_LogonControl(pipe_cli, talloc_tos(), + b = pipe_cli->binding_handle; + + status = dcerpc_netr_LogonControl(b, talloc_tos(), r->in.server_name, r->in.function_code, r->in.query_level, @@ -149,6 +152,9 @@ WERROR I_NetLogonControl_r(struct libnetapi_ctx *ctx, werr = ntstatus_to_werror(status); goto done; } + if (!W_ERROR_IS_OK(werr)) { + goto done; + } werr = construct_buffer(ctx, r->in.query_level, &query, r->out.buffer); @@ -180,6 +186,7 @@ WERROR I_NetLogonControl2_r(struct libnetapi_ctx *ctx, struct rpc_pipe_client *pipe_cli = NULL; union netr_CONTROL_DATA_INFORMATION data; union netr_CONTROL_QUERY_INFORMATION query; + struct dcerpc_binding_handle *b; werr = construct_data(r->in.function_code, r->in.data, &data); if (!W_ERROR_IS_OK(werr)) { @@ -193,11 +200,13 @@ WERROR I_NetLogonControl2_r(struct libnetapi_ctx *ctx, goto done; } + b = pipe_cli->binding_handle; + switch (r->in.function_code) { case NETLOGON_CONTROL_TC_VERIFY: case NETLOGON_CONTROL_SET_DBFLAG: case NETLOGON_CONTROL_FORCE_DNS_REG: - status = rpccli_netr_LogonControl2Ex(pipe_cli, talloc_tos(), + status = dcerpc_netr_LogonControl2Ex(b, talloc_tos(), r->in.server_name, r->in.function_code, r->in.query_level, @@ -206,7 +215,7 @@ WERROR I_NetLogonControl2_r(struct libnetapi_ctx *ctx, &werr); break; default: - status = rpccli_netr_LogonControl2(pipe_cli, talloc_tos(), + status = dcerpc_netr_LogonControl2(b, talloc_tos(), r->in.server_name, r->in.function_code, r->in.query_level, @@ -216,12 +225,12 @@ WERROR I_NetLogonControl2_r(struct libnetapi_ctx *ctx, break; } - if (!W_ERROR_IS_OK(werr)) { + if (!NT_STATUS_IS_OK(status)) { + werr = ntstatus_to_werror(status); goto done; } - if (!NT_STATUS_IS_OK(status)) { - werr = ntstatus_to_werror(status); + if (!W_ERROR_IS_OK(werr)) { goto done; } |