From 4920390913f8b9eb8601a318be56fb272cc9a43b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 11 Jan 2011 16:03:24 +0100 Subject: s3-wkssvc: prefer dcerpc_wkssvc_X functions. Guenther --- source3/lib/netapi/joindomain.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'source3/lib/netapi') diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c index 3905709d50..d17d2d82f8 100644 --- a/source3/lib/netapi/joindomain.c +++ b/source3/lib/netapi/joindomain.c @@ -26,7 +26,7 @@ #include "lib/netapi/libnetapi.h" #include "librpc/gen_ndr/libnet_join.h" #include "libnet/libnet_join.h" -#include "../librpc/gen_ndr/cli_wkssvc.h" +#include "../librpc/gen_ndr/ndr_wkssvc_c.h" #include "secrets.h" /**************************************************************** @@ -111,6 +111,7 @@ WERROR NetJoinDomain_r(struct libnetapi_ctx *ctx, NTSTATUS status; WERROR werr; unsigned int old_timeout = 0; + struct dcerpc_binding_handle *b; werr = libnetapi_open_pipe(ctx, r->in.server, &ndr_table_wkssvc.syntax_id, @@ -119,6 +120,8 @@ WERROR NetJoinDomain_r(struct libnetapi_ctx *ctx, goto done; } + b = pipe_cli->binding_handle; + if (r->in.password) { encode_wkssvc_join_password_buffer(ctx, r->in.password, @@ -128,7 +131,7 @@ WERROR NetJoinDomain_r(struct libnetapi_ctx *ctx, old_timeout = rpccli_set_timeout(pipe_cli, 600000); - status = rpccli_wkssvc_NetrJoinDomain2(pipe_cli, talloc_tos(), + status = dcerpc_wkssvc_NetrJoinDomain2(b, talloc_tos(), r->in.server, r->in.domain, r->in.account_ou, @@ -241,6 +244,7 @@ WERROR NetUnjoinDomain_r(struct libnetapi_ctx *ctx, NTSTATUS status; WERROR werr; unsigned int old_timeout = 0; + struct dcerpc_binding_handle *b; werr = libnetapi_open_pipe(ctx, r->in.server_name, &ndr_table_wkssvc.syntax_id, @@ -249,6 +253,8 @@ WERROR NetUnjoinDomain_r(struct libnetapi_ctx *ctx, goto done; } + b = pipe_cli->binding_handle; + if (r->in.password) { encode_wkssvc_join_password_buffer(ctx, r->in.password, @@ -258,7 +264,7 @@ WERROR NetUnjoinDomain_r(struct libnetapi_ctx *ctx, old_timeout = rpccli_set_timeout(pipe_cli, 60000); - status = rpccli_wkssvc_NetrUnjoinDomain2(pipe_cli, talloc_tos(), + status = dcerpc_wkssvc_NetrUnjoinDomain2(b, talloc_tos(), r->in.server_name, r->in.account, encrypted_password, @@ -287,6 +293,7 @@ WERROR NetGetJoinInformation_r(struct libnetapi_ctx *ctx, NTSTATUS status; WERROR werr; const char *buffer = NULL; + struct dcerpc_binding_handle *b; werr = libnetapi_open_pipe(ctx, r->in.server_name, &ndr_table_wkssvc.syntax_id, @@ -295,7 +302,9 @@ WERROR NetGetJoinInformation_r(struct libnetapi_ctx *ctx, goto done; } - status = rpccli_wkssvc_NetrGetJoinInformation(pipe_cli, talloc_tos(), + b = pipe_cli->binding_handle; + + status = dcerpc_wkssvc_NetrGetJoinInformation(b, talloc_tos(), r->in.server_name, &buffer, (enum wkssvc_NetJoinStatus *)r->out.name_type, @@ -421,6 +430,7 @@ WERROR NetGetJoinableOUs_r(struct libnetapi_ctx *ctx, struct wkssvc_PasswordBuffer *encrypted_password = NULL; NTSTATUS status; WERROR werr; + struct dcerpc_binding_handle *b; werr = libnetapi_open_pipe(ctx, r->in.server_name, &ndr_table_wkssvc.syntax_id, @@ -429,6 +439,8 @@ WERROR NetGetJoinableOUs_r(struct libnetapi_ctx *ctx, goto done; } + b = pipe_cli->binding_handle; + if (r->in.password) { encode_wkssvc_join_password_buffer(ctx, r->in.password, @@ -436,7 +448,7 @@ WERROR NetGetJoinableOUs_r(struct libnetapi_ctx *ctx, &encrypted_password); } - status = rpccli_wkssvc_NetrGetJoinableOus2(pipe_cli, talloc_tos(), + status = dcerpc_wkssvc_NetrGetJoinableOus2(b, talloc_tos(), r->in.server_name, r->in.domain, r->in.account, @@ -463,6 +475,7 @@ WERROR NetRenameMachineInDomain_r(struct libnetapi_ctx *ctx, struct wkssvc_PasswordBuffer *encrypted_password = NULL; NTSTATUS status; WERROR werr; + struct dcerpc_binding_handle *b; werr = libnetapi_open_pipe(ctx, r->in.server_name, &ndr_table_wkssvc.syntax_id, @@ -471,6 +484,8 @@ WERROR NetRenameMachineInDomain_r(struct libnetapi_ctx *ctx, goto done; } + b = pipe_cli->binding_handle; + if (r->in.password) { encode_wkssvc_join_password_buffer(ctx, r->in.password, @@ -478,7 +493,7 @@ WERROR NetRenameMachineInDomain_r(struct libnetapi_ctx *ctx, &encrypted_password); } - status = rpccli_wkssvc_NetrRenameMachineInDomain2(pipe_cli, talloc_tos(), + status = dcerpc_wkssvc_NetrRenameMachineInDomain2(b, talloc_tos(), r->in.server_name, r->in.new_machine_name, r->in.account, -- cgit