summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2004-02-19 15:59:35 +0000
committerJim McDonough <jmcd@samba.org>2004-02-19 15:59:35 +0000
commit39a154ae928ed03c130f3879cd0f381031ea453b (patch)
tree086b7000652c14f95a685445d91f0a766b2a1ce4 /source3/passdb
parent955ec7c6e237775f1835f22288b1295f1b04ba8f (diff)
downloadsamba-39a154ae928ed03c130f3879cd0f381031ea453b.tar.gz
samba-39a154ae928ed03c130f3879cd0f381031ea453b.tar.bz2
samba-39a154ae928ed03c130f3879cd0f381031ea453b.zip
Add functions to get/set bad password time
(This used to be commit 557f598c63f64c1c5b982a9057c0eea2a2ff2ee5)
Diffstat (limited to 'source3/passdb')
-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 2d6b065cbd..c8f28db30f 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)
@@ -390,6 +398,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)