diff options
author | Jean-François Micouleau <jfm@samba.org> | 2001-12-03 17:14:23 +0000 |
---|---|---|
committer | Jean-François Micouleau <jfm@samba.org> | 2001-12-03 17:14:23 +0000 |
commit | cdf9b42754b7e97faa7fc4eb1ec69e32c0bfd1a0 (patch) | |
tree | 7af8817fc9a706d3152635395e1e689495f874b4 /source3/passdb/passdb.c | |
parent | fc85a6096231d7e8c45c150f2beaa99c16e9227a (diff) | |
download | samba-cdf9b42754b7e97faa7fc4eb1ec69e32c0bfd1a0.tar.gz samba-cdf9b42754b7e97faa7fc4eb1ec69e32c0bfd1a0.tar.bz2 samba-cdf9b42754b7e97faa7fc4eb1ec69e32c0bfd1a0.zip |
added a tdb to store the account policy informations.
You can change them with either usermanager->policies->account
or from a command prompt on NT/W2K: net accounts /domain
we can add a rpc accounts to the net command. As the net_rpc.c is still
empty, I did not start. How should I add command to it ? Should I take the
rpcclient/cmd_xxx functions and call them from there ?
alse changed the SAM_UNK_INFO_3 parser, it's an NTTIME. This one is more
for jeremy ;-)
J.F.
(This used to be commit bc28a8eebd9245ce3004ae4b1a359db51f77bf21)
Diffstat (limited to 'source3/passdb/passdb.c')
-rw-r--r-- | source3/passdb/passdb.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index 8555186826..e469718b5c 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -1776,6 +1776,7 @@ BOOL pdb_set_hours (SAM_ACCOUNT *sampass, const uint8 *hours) BOOL pdb_set_pass_changed_now (SAM_ACCOUNT *sampass) { + time_t expire; if (!sampass) return False; @@ -1783,10 +1784,17 @@ BOOL pdb_set_pass_changed_now (SAM_ACCOUNT *sampass) if (!pdb_set_pass_last_set_time (sampass, time(NULL))) return False; - if (!pdb_set_pass_must_change_time (sampass, + account_policy_get(AP_MAX_PASSWORD_AGE, (int *)&expire); + + if (expire==-1) { + if (!pdb_set_pass_must_change_time (sampass, 0)) + return False; + } else { + if (!pdb_set_pass_must_change_time (sampass, pdb_get_pass_last_set_time(sampass) - + MAX_PASSWORD_AGE)) - return False; + + expire)) + return False; + } return True; } |