summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2004-02-19 15:59:30 +0000
committerJim McDonough <jmcd@samba.org>2004-02-19 15:59:30 +0000
commit549fe06682e3b2446543b98061a4da419d13489f (patch)
treeae2f89fd98074a45a460c277e4074049aa6c34da
parentc32cfdb505d711f1496f81fe646fa42f1c29d91f (diff)
downloadsamba-549fe06682e3b2446543b98061a4da419d13489f.tar.gz
samba-549fe06682e3b2446543b98061a4da419d13489f.tar.bz2
samba-549fe06682e3b2446543b98061a4da419d13489f.zip
Add functions to get/set bad password time
(This used to be commit 0a2b792556b3aaa056a1fa6adb35627fdb804758)
-rw-r--r--source3/passdb/passdb.c3
-rw-r--r--source3/passdb/pdb_get_set.c19
2 files changed, 21 insertions, 1 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index 603b4d71d2..ddba4c6897 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -1819,6 +1819,7 @@ BOOL init_sam_from_buffer_v1(SAM_ACCOUNT *sampass, uint8 *buf, uint32 buflen)
pdb_set_logon_time(sampass, logon_time, PDB_SET);
pdb_set_logoff_time(sampass, logoff_time, PDB_SET);
pdb_set_kickoff_time(sampass, kickoff_time, PDB_SET);
+ pdb_set_bad_password_time(sampass, bad_password_time, PDB_SET);
pdb_set_pass_can_change_time(sampass, pass_can_change_time, PDB_SET);
pdb_set_pass_must_change_time(sampass, pass_must_change_time, PDB_SET);
pdb_set_pass_last_set_time(sampass, pass_last_set_time, PDB_SET);
@@ -1960,7 +1961,7 @@ uint32 init_buffer_from_sam_v1 (uint8 **buf, const SAM_ACCOUNT *sampass, BOOL si
logon_time = (uint32)pdb_get_logon_time(sampass);
logoff_time = (uint32)pdb_get_logoff_time(sampass);
kickoff_time = (uint32)pdb_get_kickoff_time(sampass);
- bad_password_time = (uint32)0;
+ bad_password_time = (uint32)pdb_get_bad_password_time(sampass);
pass_can_change_time = (uint32)pdb_get_pass_can_change_time(sampass);
pass_must_change_time = (uint32)pdb_get_pass_must_change_time(sampass);
pass_last_set_time = (uint32)pdb_get_pass_last_set_time(sampass);
diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c
index be03157636..3974115588 100644
--- a/source3/passdb/pdb_get_set.c
+++ b/source3/passdb/pdb_get_set.c
@@ -72,6 +72,14 @@ time_t pdb_get_kickoff_time (const SAM_ACCOUNT *sampass)
return (-1);
}
+time_t pdb_get_bad_password_time (const SAM_ACCOUNT *sampass)
+{
+ if (sampass)
+ return (sampass->private.bad_password_time);
+ else
+ return (-1);
+}
+
time_t pdb_get_pass_last_set_time (const SAM_ACCOUNT *sampass)
{
if (sampass)
@@ -382,6 +390,17 @@ BOOL pdb_set_kickoff_time (SAM_ACCOUNT *sampass, time_t mytime, enum pdb_value_s
return pdb_set_init_flags(sampass, PDB_KICKOFFTIME, flag);
}
+BOOL pdb_set_bad_password_time (SAM_ACCOUNT *sampass, time_t mytime,
+ enum pdb_value_state flag)
+{
+ if (!sampass)
+ return False;
+
+ sampass->private.bad_password_time = mytime;
+
+ return pdb_set_init_flags(sampass, PDB_BAD_PASSWORD_TIME, flag);
+}
+
BOOL pdb_set_pass_can_change_time (SAM_ACCOUNT *sampass, time_t mytime, enum pdb_value_state flag)
{
if (!sampass)