1
0
mirror of https://github.com/samba-team/samba.git synced 2025-05-28 21:05:48 +03:00

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>
This commit is contained in:
Volker Lendecke 2012-06-22 14:26:45 +02:00 committed by Stefan Metzmacher
parent 51b30c61f4
commit b9a15f1bfa

View File

@ -625,11 +625,14 @@ NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
if (cli->dc->negotiate_flags & NETLOGON_NEG_PASSWORD_SET2) { if (cli->dc->negotiate_flags & NETLOGON_NEG_PASSWORD_SET2) {
struct netr_CryptPassword new_password; struct netr_CryptPassword new_password;
uint32_t old_timeout;
init_netr_CryptPassword(new_trust_pwd_cleartext, init_netr_CryptPassword(new_trust_pwd_cleartext,
cli->dc->session_key, cli->dc->session_key,
&new_password); &new_password);
old_timeout = dcerpc_binding_handle_set_timeout(b, 600000);
status = dcerpc_netr_ServerPasswordSet2(b, mem_ctx, status = dcerpc_netr_ServerPasswordSet2(b, mem_ctx,
cli->srv_name_slash, cli->srv_name_slash,
cli->dc->account_name, cli->dc->account_name,
@ -639,6 +642,9 @@ NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
&srv_cred, &srv_cred,
&new_password, &new_password,
&result); &result);
dcerpc_binding_handle_set_timeout(b, old_timeout);
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("dcerpc_netr_ServerPasswordSet2 failed: %s\n", DEBUG(0,("dcerpc_netr_ServerPasswordSet2 failed: %s\n",
nt_errstr(status))); nt_errstr(status)));
@ -647,9 +653,13 @@ NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
} else { } else {
struct samr_Password new_password; struct samr_Password new_password;
uint32_t old_timeout;
memcpy(new_password.hash, new_trust_passwd_hash, sizeof(new_password.hash)); memcpy(new_password.hash, new_trust_passwd_hash, sizeof(new_password.hash));
netlogon_creds_des_encrypt(cli->dc, &new_password); netlogon_creds_des_encrypt(cli->dc, &new_password);
old_timeout = dcerpc_binding_handle_set_timeout(b, 600000);
status = dcerpc_netr_ServerPasswordSet(b, mem_ctx, status = dcerpc_netr_ServerPasswordSet(b, mem_ctx,
cli->srv_name_slash, cli->srv_name_slash,
cli->dc->account_name, cli->dc->account_name,
@ -659,6 +669,9 @@ NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
&srv_cred, &srv_cred,
&new_password, &new_password,
&result); &result);
dcerpc_binding_handle_set_timeout(b, old_timeout);
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("dcerpc_netr_ServerPasswordSet failed: %s\n", DEBUG(0,("dcerpc_netr_ServerPasswordSet failed: %s\n",
nt_errstr(status))); nt_errstr(status)));