diff options
author | Günther Deschner <gd@samba.org> | 2011-03-24 22:14:20 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2011-03-24 23:08:22 +0100 |
commit | 63bb64d531bccc963e3131658f6c37887f820e87 (patch) | |
tree | d9d04904052fe3e612f29a8e6d9bfb676993958f /source3/lib/netapi/joindomain.c | |
parent | 042aafb87df6c05877b8fc7ef0d44877689d860a (diff) | |
download | samba-63bb64d531bccc963e3131658f6c37887f820e87.tar.gz samba-63bb64d531bccc963e3131658f6c37887f820e87.tar.bz2 samba-63bb64d531bccc963e3131658f6c37887f820e87.zip |
s3-netapi: use cli_get_session_key() in netapi.
Guenther
Diffstat (limited to 'source3/lib/netapi/joindomain.c')
-rw-r--r-- | source3/lib/netapi/joindomain.c | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c index 6bae363b14..edc45efe9e 100644 --- a/source3/lib/netapi/joindomain.c +++ b/source3/lib/netapi/joindomain.c @@ -113,6 +113,7 @@ WERROR NetJoinDomain_r(struct libnetapi_ctx *ctx, WERROR werr; unsigned int old_timeout = 0; struct dcerpc_binding_handle *b; + DATA_BLOB session_key; werr = libnetapi_open_pipe(ctx, r->in.server, &ndr_table_wkssvc.syntax_id, @@ -124,9 +125,16 @@ WERROR NetJoinDomain_r(struct libnetapi_ctx *ctx, b = pipe_cli->binding_handle; if (r->in.password) { + + status = cli_get_session_key(ctx, pipe_cli, &session_key); + if (!NT_STATUS_IS_OK(status)) { + werr = ntstatus_to_werror(status); + goto done; + } + encode_wkssvc_join_password_buffer(ctx, r->in.password, - &pipe_cli->auth->user_session_key, + &session_key, &encrypted_password); } @@ -246,6 +254,7 @@ WERROR NetUnjoinDomain_r(struct libnetapi_ctx *ctx, WERROR werr; unsigned int old_timeout = 0; struct dcerpc_binding_handle *b; + DATA_BLOB session_key; werr = libnetapi_open_pipe(ctx, r->in.server_name, &ndr_table_wkssvc.syntax_id, @@ -257,9 +266,16 @@ WERROR NetUnjoinDomain_r(struct libnetapi_ctx *ctx, b = pipe_cli->binding_handle; if (r->in.password) { + + status = cli_get_session_key(ctx, pipe_cli, &session_key); + if (!NT_STATUS_IS_OK(status)) { + werr = ntstatus_to_werror(status); + goto done; + } + encode_wkssvc_join_password_buffer(ctx, r->in.password, - &pipe_cli->auth->user_session_key, + &session_key, &encrypted_password); } @@ -436,6 +452,7 @@ WERROR NetGetJoinableOUs_r(struct libnetapi_ctx *ctx, NTSTATUS status; WERROR werr; struct dcerpc_binding_handle *b; + DATA_BLOB session_key; werr = libnetapi_open_pipe(ctx, r->in.server_name, &ndr_table_wkssvc.syntax_id, @@ -447,9 +464,16 @@ WERROR NetGetJoinableOUs_r(struct libnetapi_ctx *ctx, b = pipe_cli->binding_handle; if (r->in.password) { + + status = cli_get_session_key(ctx, pipe_cli, &session_key); + if (!NT_STATUS_IS_OK(status)) { + werr = ntstatus_to_werror(status); + goto done; + } + encode_wkssvc_join_password_buffer(ctx, r->in.password, - &pipe_cli->auth->user_session_key, + &session_key, &encrypted_password); } @@ -481,6 +505,7 @@ WERROR NetRenameMachineInDomain_r(struct libnetapi_ctx *ctx, NTSTATUS status; WERROR werr; struct dcerpc_binding_handle *b; + DATA_BLOB session_key; werr = libnetapi_open_pipe(ctx, r->in.server_name, &ndr_table_wkssvc.syntax_id, @@ -492,9 +517,16 @@ WERROR NetRenameMachineInDomain_r(struct libnetapi_ctx *ctx, b = pipe_cli->binding_handle; if (r->in.password) { + + status = cli_get_session_key(ctx, pipe_cli, &session_key); + if (!NT_STATUS_IS_OK(status)) { + werr = ntstatus_to_werror(status); + goto done; + } + encode_wkssvc_join_password_buffer(ctx, r->in.password, - &pipe_cli->auth->user_session_key, + &session_key, &encrypted_password); } |