diff options
author | Günther Deschner <gd@samba.org> | 2008-09-02 13:17:57 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-09-05 13:13:44 +0200 |
commit | 8cb544e2a1806b863bb5a1f49b6642b99435aa55 (patch) | |
tree | 7ff3f9c8a9c42a4bcf8d0993badc2faf0af2820b /source3/lib/netapi | |
parent | 10e8f90a65a95e3b2aeda467ec37b5c94288f2a6 (diff) | |
download | samba-8cb544e2a1806b863bb5a1f49b6642b99435aa55.tar.gz samba-8cb544e2a1806b863bb5a1f49b6642b99435aa55.tar.bz2 samba-8cb544e2a1806b863bb5a1f49b6642b99435aa55.zip |
netapi: implement NetRenameMachineInDomain_r.
Guenther
(This used to be commit 39a42380ca3fac92eb27bded90ab06f7760937b9)
Diffstat (limited to 'source3/lib/netapi')
-rw-r--r-- | source3/lib/netapi/joindomain.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c index 6bf1cad312..d15e2e733c 100644 --- a/source3/lib/netapi/joindomain.c +++ b/source3/lib/netapi/joindomain.c @@ -454,7 +454,41 @@ WERROR NetGetJoinableOUs_r(struct libnetapi_ctx *ctx, WERROR NetRenameMachineInDomain_r(struct libnetapi_ctx *ctx, struct NetRenameMachineInDomain *r) { - return WERR_NOT_SUPPORTED; + struct cli_state *cli = NULL; + struct rpc_pipe_client *pipe_cli = NULL; + struct wkssvc_PasswordBuffer *encrypted_password = NULL; + NTSTATUS status; + WERROR werr; + + werr = libnetapi_open_pipe(ctx, r->in.server_name, + &ndr_table_wkssvc.syntax_id, + &cli, + &pipe_cli); + if (!W_ERROR_IS_OK(werr)) { + goto done; + } + + if (r->in.password) { + encode_wkssvc_join_password_buffer(ctx, + r->in.password, + &cli->user_session_key, + &encrypted_password); + } + + status = rpccli_wkssvc_NetrRenameMachineInDomain2(pipe_cli, ctx, + r->in.server_name, + r->in.new_machine_name, + r->in.account, + encrypted_password, + r->in.rename_options, + &werr); + if (!NT_STATUS_IS_OK(status)) { + werr = ntstatus_to_werror(status); + goto done; + } + + done: + return werr; } /**************************************************************** |