diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-03-22 08:09:22 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-03-22 08:09:22 +0000 |
commit | 0655f20f9681ec910f5be8e48165a9d2420e00ec (patch) | |
tree | bc8c8ea64d60707054945aff28eb3485178df7a4 /source3/passdb | |
parent | 67df8fb3003a25d274d805c8db6af8eaf30a9d24 (diff) | |
download | samba-0655f20f9681ec910f5be8e48165a9d2420e00ec.tar.gz samba-0655f20f9681ec910f5be8e48165a9d2420e00ec.tar.bz2 samba-0655f20f9681ec910f5be8e48165a9d2420e00ec.zip |
Merge from HEAD - patch from Jianliang Lu <j.lu@tiesse.com> to set the
'minimum password age' during a password SET.
Andrew Bartlett
(This used to be commit dd6516e2e87cbe6bcbc371756d99ebb3b5617c2b)
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/pdb_get_set.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c index 6ca3acc4eb..80b4bb4dc3 100644 --- a/source3/passdb/pdb_get_set.c +++ b/source3/passdb/pdb_get_set.c @@ -1064,6 +1064,7 @@ BOOL pdb_set_hours (SAM_ACCOUNT *sampass, const uint8 *hours, enum pdb_value_sta BOOL pdb_set_pass_changed_now (SAM_ACCOUNT *sampass) { uint32 expire; + uint32 min_age; if (!sampass) return False; @@ -1082,6 +1083,16 @@ BOOL pdb_set_pass_changed_now (SAM_ACCOUNT *sampass) return False; } + if (!account_policy_get(AP_MIN_PASSWORD_AGE, &min_age) + || (min_age==(uint32)-1)) { + if (!pdb_set_pass_can_change_time (sampass, 0, PDB_CHANGED)) + return False; + } else { + if (!pdb_set_pass_can_change_time (sampass, + pdb_get_pass_last_set_time(sampass) + + min_age, PDB_CHANGED)) + return False; + } return True; } |