1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

Always initialise this variable - and don't set the 'must change now' if it was

last changed at '0'.

We need to actually change this password sometime...

Andrew Bartlett
(This used to be commit 740bf439d2d1512127c873cf0e57697161d6566b)
This commit is contained in:
Andrew Bartlett 2003-01-13 21:49:49 +00:00
parent 5368372382
commit 1276959d7c
2 changed files with 3 additions and 1 deletions

View File

@ -432,7 +432,8 @@ static NTSTATUS check_ntdomain_security(const struct auth_context *auth_context,
/* Test if machine password has expired and needs to be changed */
if (lp_machine_password_timeout()) {
if (time(NULL) > (last_change_time +
if (last_change_time > 0 &&
time(NULL) > (last_change_time +
lp_machine_password_timeout())) {
global_machine_password_needs_changing = True;
}

View File

@ -240,6 +240,7 @@ BOOL secrets_fetch_trust_account_password(const char *domain, uint8 ret_pwd[16],
DEBUG(4,("Using ADS machine password\n"));
E_md4hash(plaintext, ret_pwd);
SAFE_FREE(plaintext);
pass_last_set_time = 0;
return True;
}