NTSTATUS auth_get_challenge(struct auth4_context *auth_ctx, uint8_t chal[8]);
NTSTATUS authsam_account_ok(TALLOC_CTX *mem_ctx,
struct ldb_context *sam_ctx,
+ NTTIME now,
uint32_t logon_parameters,
struct ldb_dn *domain_dn,
struct ldb_message *msg,
uint32_t userAccountControl = 0;
uint32_t current_kvno = 0;
bool am_rodc;
+ NTTIME now;
+ bool time_ok;
+
+ time_ok = dsdb_gmsa_current_time(sam_ctx, &now);
+ if (!time_ok) {
+ return NT_STATUS_INTERNAL_ERROR;
+ }
tmp_ctx = talloc_new(mem_ctx);
if (tmp_ctx == NULL) {
for (i = 1; i < MIN(history_len, 3); i++) {
const struct samr_Password *nt_history_pwd = NULL;
NTTIME pwdLastSet;
- NTTIME now;
int allowed_period_mins;
NTTIME allowed_period;
- bool ok;
bool is_gmsa;
/* Reset these variables back to starting as empty */
allowed_period = (NTTIME) allowed_period_mins *
60 * 1000*1000*10;
pwdLastSet = samdb_result_nttime(msg, "pwdLastSet", 0);
- ok = dsdb_gmsa_current_time(sam_ctx, &now);
- if (!ok) {
- TALLOC_FREE(tmp_ctx);
- return NT_STATUS_WRONG_PASSWORD;
- }
if (now < pwdLastSet) {
/*
uint32_t acct_flags = samdb_result_acct_flags(msg, NULL);
struct netr_SendToSamBase *send_to_sam = NULL;
const struct authn_ntlm_client_policy *authn_client_policy = NULL;
- TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
+ struct ldb_context *sam_ctx = auth_context->sam_ctx;
+ TALLOC_CTX *tmp_ctx = NULL;
+ NTTIME now;
+ bool time_ok;
+
+ time_ok = dsdb_gmsa_current_time(sam_ctx, &now);
+ if (!time_ok) {
+ return NT_STATUS_INTERNAL_ERROR;
+ }
+
+ tmp_ctx = talloc_new(mem_ctx);
if (!tmp_ctx) {
return NT_STATUS_NO_MEMORY;
}
}
nt_status = authsam_account_ok(tmp_ctx, auth_context->sam_ctx,
+ now,
user_info->logon_parameters,
domain_dn,
msg,
****************************************************************************/
_PUBLIC_ NTSTATUS authsam_account_ok(TALLOC_CTX *mem_ctx,
struct ldb_context *sam_ctx,
+ NTTIME now,
uint32_t logon_parameters,
struct ldb_dn *domain_dn,
struct ldb_message *msg,
const char *workstation_list;
NTTIME acct_expiry;
NTTIME must_change_time;
- struct timeval tv_now = timeval_current();
- NTTIME now = timeval_to_nttime(&tv_now);
DEBUG(4,("authsam_account_ok: Checking SMB password for user %s\n", name_for_logs));
/* we allow all kinds of trusts here */
nt_status = authsam_account_ok(tmp_ctx,
kdc_entry->kdc_db_ctx->samdb,
+ kdc_entry->current_nttime,
MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT |
MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT,
kdc_entry->realm_dn, kdc_entry->msg,