summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-06-22 14:26:45 +0200
committerStefan Metzmacher <metze@samba.org>2012-06-22 17:28:20 +0200
commitb9a15f1bfad30a824f9ec87bc9f7c65adf50dae0 (patch)
treeb25736dea5db3b9a84a8e3f89207606e6615a02c /source3/rpc_client
parent51b30c61f4cfc257b4a3938363041214a4106907 (diff)
downloadsamba-b9a15f1bfad30a824f9ec87bc9f7c65adf50dae0.tar.gz
samba-b9a15f1bfad30a824f9ec87bc9f7c65adf50dae0.tar.bz2
samba-b9a15f1bfad30a824f9ec87bc9f7c65adf50dae0.zip
s3: Give machine password changes 10 minutes of time
This is what we do at domain join time as well, see lib/netapi/joindomain.c:141 Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_netlogon.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c
index 3c685fd9a7..bbcca06a60 100644
--- a/source3/rpc_client/cli_netlogon.c
+++ b/source3/rpc_client/cli_netlogon.c
@@ -625,11 +625,14 @@ NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
if (cli->dc->negotiate_flags & NETLOGON_NEG_PASSWORD_SET2) {
struct netr_CryptPassword new_password;
+ uint32_t old_timeout;
init_netr_CryptPassword(new_trust_pwd_cleartext,
cli->dc->session_key,
&new_password);
+ old_timeout = dcerpc_binding_handle_set_timeout(b, 600000);
+
status = dcerpc_netr_ServerPasswordSet2(b, mem_ctx,
cli->srv_name_slash,
cli->dc->account_name,
@@ -639,6 +642,9 @@ NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
&srv_cred,
&new_password,
&result);
+
+ dcerpc_binding_handle_set_timeout(b, old_timeout);
+
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("dcerpc_netr_ServerPasswordSet2 failed: %s\n",
nt_errstr(status)));
@@ -647,9 +653,13 @@ NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
} else {
struct samr_Password new_password;
+ uint32_t old_timeout;
+
memcpy(new_password.hash, new_trust_passwd_hash, sizeof(new_password.hash));
netlogon_creds_des_encrypt(cli->dc, &new_password);
+ old_timeout = dcerpc_binding_handle_set_timeout(b, 600000);
+
status = dcerpc_netr_ServerPasswordSet(b, mem_ctx,
cli->srv_name_slash,
cli->dc->account_name,
@@ -659,6 +669,9 @@ NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
&srv_cred,
&new_password,
&result);
+
+ dcerpc_binding_handle_set_timeout(b, old_timeout);
+
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("dcerpc_netr_ServerPasswordSet failed: %s\n",
nt_errstr(status)));