info = user_info_dc->info;
- sam->last_logon = info->last_logon;
- sam->last_logoff = info->last_logoff;
- sam->acct_expiry = info->acct_expiry;
+ sam->logon_time = info->last_logon;
+ sam->logoff_time = info->last_logoff;
+ sam->kickoff_time = info->acct_expiry;
sam->last_password_change = info->last_password_change;
sam->allow_password_change = info->allow_password_change;
sam->force_password_change = info->force_password_change;
}
sam->acct_flags = user_info_dc->info->acct_flags;
sam->logon_server.string = user_info_dc->info->logon_server;
- sam->domain.string = user_info_dc->info->domain_name;
-
- ZERO_STRUCT(sam->unknown);
+ sam->logon_domain.string = user_info_dc->info->domain_name;
+ sam->sub_auth_status = 0;
+ sam->last_successful_logon = 0;
+ sam->last_failed_logon = 0;
+ sam->failed_logon_count = 0;
+ sam->reserved = 0;
ZERO_STRUCT(sam->key);
if (user_info_dc->user_session_key.length == sizeof(sam->key.key)) {
sam3->sids = talloc_array(sam, struct netr_SidAttr,
user_info_dc->num_sids);
- NT_STATUS_HAVE_NO_MEMORY_AND_FREE(sam3->sids, sam3);
+ if (sam3->sids == NULL) {
+ TALLOC_FREE(sam3);
+ return NT_STATUS_NO_MEMORY;
+ }
/* We don't put the user and group SIDs in there */
for (i=2; i<user_info_dc->num_sids; i++) {
continue;
}
sam3->sids[sam3->sidcount].sid = dom_sid_dup(sam3->sids, &user_info_dc->sids[i]);
- NT_STATUS_HAVE_NO_MEMORY_AND_FREE(sam3->sids[sam3->sidcount].sid, sam3);
+ if (sam3->sids[sam3->sidcount].sid == NULL) {
+ TALLOC_FREE(sam3);
+ return NT_STATUS_NO_MEMORY;
+ }
sam3->sids[sam3->sidcount].attributes =
SE_GROUP_MANDATORY | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_ENABLED;
sam3->sidcount += 1;
}
NT_STATUS_HAVE_NO_MEMORY(info->account_name);
- if (base->domain.string) {
- info->domain_name = talloc_strdup(info, base->domain.string);
+ if (base->logon_domain.string) {
+ info->domain_name = talloc_strdup(info, base->logon_domain.string);
NT_STATUS_HAVE_NO_MEMORY(info->domain_name);
}
info->logon_server = talloc_strdup(info, base->logon_server.string);
NT_STATUS_HAVE_NO_MEMORY(info->logon_server);
}
- info->last_logon = base->last_logon;
- info->last_logoff = base->last_logoff;
- info->acct_expiry = base->acct_expiry;
+ info->last_logon = base->logon_time;
+ info->last_logoff = base->logoff_time;
+ info->acct_expiry = base->kickoff_time;
info->last_password_change = base->last_password_change;
info->allow_password_change = base->allow_password_change;
info->force_password_change = base->force_password_change;
info->bad_password_count = base->bad_password_count;
info->acct_flags = base->acct_flags;
- info->authenticated = authenticated;
+ /* Only set authenticated if both NETLOGON_GUEST is not set, and authenticated is set */
+ info->authenticated = (authenticated && (!(base->user_flags & NETLOGON_GUEST)));
*_user_info = info;
return NT_STATUS_OK;
sidcount = user_info_dc->num_sids + pac_logon_info->res_groups.count;
user_info_dc->sids
= talloc_realloc(user_info_dc, user_info_dc->sids, struct dom_sid, sidcount);
- NT_STATUS_HAVE_NO_MEMORY_AND_FREE(user_info_dc->sids, user_info_dc);
+ if (user_info_dc->sids == NULL) {
+ TALLOC_FREE(user_info_dc);
+ return NT_STATUS_NO_MEMORY;
+ }
for (i = 0; pac_logon_info->res_group_dom_sid && i < pac_logon_info->res_groups.count; i++) {
user_info_dc->sids[user_info_dc->num_sids] = *pac_logon_info->res_group_dom_sid;