struct netr_Credential clnt_chal_send;
struct netr_Credential srv_chal_recv;
struct dcinfo *dc;
+ bool retried = false;
SMB_ASSERT(cli->pipe_idx == PI_NETLOGON);
fstr_sprintf( dc->mach_acct, "%s$", machine_account);
+ again:
/* Create the client challenge. */
generate_random_buffer(clnt_chal_send.data, 8);
/* Get the server challenge. */
- result = rpccli_netr_ServerReqChallenge(cli, cli->mem_ctx,
+ result = rpccli_netr_ServerReqChallenge(cli, talloc_tos(),
dc->remote_machine,
clnt_name,
&clnt_chal_send,
* Send client auth-2 challenge and receive server repy.
*/
- result = rpccli_netr_ServerAuthenticate2(cli, cli->mem_ctx,
+ result = rpccli_netr_ServerAuthenticate2(cli, talloc_tos(),
dc->remote_machine,
dc->mach_acct,
sec_chan_type,
&clnt_chal_send, /* input. */
&srv_chal_recv, /* output. */
neg_flags_inout);
+
+ /* we might be talking to NT4, so let's downgrade in that case and retry
+ * with the returned neg_flags - gd */
+
+ if (NT_STATUS_EQUAL(result, NT_STATUS_ACCESS_DENIED) && !retried) {
+ retried = true;
+ goto again;
+ }
+
if (!NT_STATUS_IS_OK(result)) {
return result;
}
*/
DEBUG(0,("rpccli_netlogon_setup_creds: server %s "
"replied with bad credential\n",
- cli->cli->desthost ));
+ cli->desthost ));
return NT_STATUS_ACCESS_DENIED;
}
DEBUG(5,("rpccli_netlogon_setup_creds: server %s credential "
"chain established.\n",
- cli->cli->desthost ));
+ cli->desthost ));
return NT_STATUS_OK;
}
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
struct netr_Authenticator clnt_creds;
struct netr_Authenticator ret_creds;
- union netr_LogonLevel *logon;
+ union netr_LogonInfo *logon;
union netr_Validation validation;
uint8_t authoritative;
int validation_level = 3;
ZERO_STRUCT(ret_creds);
ZERO_STRUCT(zeros);
- logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonLevel);
+ logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonInfo);
if (!logon) {
return NT_STATUS_NO_MEMORY;
}
uint8 zeros[16];
struct netr_Authenticator clnt_creds;
struct netr_Authenticator ret_creds;
- union netr_LogonLevel *logon = NULL;
+ union netr_LogonInfo *logon = NULL;
struct netr_NetworkInfo *network_info;
uint8_t authoritative;
union netr_Validation validation;
ZERO_STRUCT(lm);
ZERO_STRUCT(nt);
- logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonLevel);
+ logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonInfo);
if (!logon) {
return NT_STATUS_NO_MEMORY;
}
const char *workstation_name_slash;
const char *server_name_slash;
uint8 zeros[16];
- union netr_LogonLevel *logon = NULL;
+ union netr_LogonInfo *logon = NULL;
struct netr_NetworkInfo *network_info;
uint8_t authoritative;
union netr_Validation validation;
ZERO_STRUCT(lm);
ZERO_STRUCT(nt);
- logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonLevel);
+ logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonInfo);
if (!logon) {
return NT_STATUS_NO_MEMORY;
}
*info3 = validation.sam3;
return result;
-
- return result;
}