1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

Give NetJoinDomain() enough time to finish.

Guenther
(This used to be commit 7f021b3cb7)
This commit is contained in:
Günther Deschner 2007-11-30 19:55:40 +01:00 committed by Volker Lendecke
parent 5ee27320ce
commit 1484b1d174

View File

@ -33,6 +33,7 @@ WERROR NetJoinDomain(const char *server_name,
struct wkssvc_PasswordBuffer encrypted_password; struct wkssvc_PasswordBuffer encrypted_password;
NTSTATUS status; NTSTATUS status;
WERROR werr; WERROR werr;
unsigned int old_timeout;
mem_ctx = talloc_init("NetJoinDomain"); mem_ctx = talloc_init("NetJoinDomain");
if (!mem_ctx) { if (!mem_ctx) {
@ -58,6 +59,8 @@ WERROR NetJoinDomain(const char *server_name,
goto done; goto done;
} }
old_timeout = cli_set_timeout(cli, 60000);
pipe_cli = cli_rpc_pipe_open_noauth(cli, PI_WKSSVC, pipe_cli = cli_rpc_pipe_open_noauth(cli, PI_WKSSVC,
&status); &status);
if (!pipe_cli) { if (!pipe_cli) {
@ -70,6 +73,8 @@ WERROR NetJoinDomain(const char *server_name,
&cli->user_session_key, &cli->user_session_key,
&encrypted_password); &encrypted_password);
old_timeout = cli_set_timeout(cli, 60000);
status = rpccli_wkssvc_NetrJoinDomain2(pipe_cli, mem_ctx, status = rpccli_wkssvc_NetrJoinDomain2(pipe_cli, mem_ctx,
server_name, domain_name, server_name, domain_name,
account_ou, Account, account_ou, Account,
@ -82,6 +87,7 @@ WERROR NetJoinDomain(const char *server_name,
werr = WERR_OK; werr = WERR_OK;
done: done:
cli_set_timeout(cli, old_timeout);
cli_shutdown(cli); cli_shutdown(cli);
TALLOC_FREE(mem_ctx); TALLOC_FREE(mem_ctx);