mirror of
https://github.com/samba-team/samba.git
synced 2025-12-14 20:23:54 +03:00
r18722: Fix up password change times. The can change and must change times are
calculated based on the last change time, policies, and acb flags. Next step will be to not bother storing them. Right now I'm just trying to get them reported correctly.
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
867eeaafce
commit
fd5761c9e5
@@ -6270,6 +6270,7 @@ NTSTATUS init_sam_user_info21A(SAM_USER_INFO_21 *usr, struct samu *pw, DOM_SID *
|
||||
pass_last_set_time, pass_can_change_time,
|
||||
pass_must_change_time;
|
||||
|
||||
time_t must_change_time;
|
||||
const char* user_name = pdb_get_username(pw);
|
||||
const char* full_name = pdb_get_fullname(pw);
|
||||
const char* home_dir = pdb_get_homedir(pw);
|
||||
@@ -6294,12 +6295,16 @@ NTSTATUS init_sam_user_info21A(SAM_USER_INFO_21 *usr, struct samu *pw, DOM_SID *
|
||||
}
|
||||
|
||||
/* Create NTTIME structs */
|
||||
unix_to_nt_time (&logon_time, pdb_get_logon_time(pw));
|
||||
unix_to_nt_time (&logoff_time, pdb_get_logoff_time(pw));
|
||||
unix_to_nt_time (&logon_time, pdb_get_logon_time(pw));
|
||||
unix_to_nt_time (&logoff_time, pdb_get_logoff_time(pw));
|
||||
unix_to_nt_time (&kickoff_time, pdb_get_kickoff_time(pw));
|
||||
unix_to_nt_time (&pass_last_set_time, pdb_get_pass_last_set_time(pw));
|
||||
unix_to_nt_time (&pass_can_change_time, pdb_get_pass_can_change_time(pw));
|
||||
unix_to_nt_time (&pass_must_change_time,pdb_get_pass_must_change_time(pw));
|
||||
unix_to_nt_time (&pass_last_set_time, pdb_get_pass_last_set_time(pw));
|
||||
unix_to_nt_time (&pass_can_change_time,pdb_get_pass_can_change_time(pw));
|
||||
must_change_time = pdb_get_pass_must_change_time(pw);
|
||||
if (must_change_time == get_time_t_max())
|
||||
unix_to_nt_time_abs(&pass_must_change_time, must_change_time);
|
||||
else
|
||||
unix_to_nt_time(&pass_must_change_time, must_change_time);
|
||||
|
||||
/* structure assignment */
|
||||
usr->logon_time = logon_time;
|
||||
|
||||
Reference in New Issue
Block a user