diff options
author | Jeremy Allison <jra@samba.org> | 2003-09-18 23:54:12 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-09-18 23:54:12 +0000 |
commit | 30fd3599143260ee6893a5125e7ec7cec8bb2289 (patch) | |
tree | a35349d238a72e05fbc8871929013be8b910bcb4 /source3/passdb/pdb_get_set.c | |
parent | 8e0a88b7e2f84175860225363ff17584e6e1ddd4 (diff) | |
download | samba-30fd3599143260ee6893a5125e7ec7cec8bb2289.tar.gz samba-30fd3599143260ee6893a5125e7ec7cec8bb2289.tar.bz2 samba-30fd3599143260ee6893a5125e7ec7cec8bb2289.zip |
The "unknown_5" 32 bit field in the user structs is actually 2 16-bit
fields, bad_password_count and logon_count. Ensure this is stored/fetched
in the various SAMs. As it replaces the unknown_5 field this fits
exactly into the tdb SAM without any binary problems. It also is added
to the LDAP SAM as two extra attributes. It breaks compatibility with
the experimental SAMs xml and mysql. The maintainers of these SAMs must
fix them so upgrades like this can be done transparently. I will insist
on the "experimental" status until this is solved.
Jeremy.
(This used to be commit 71ecd10181cd35313b79f618c2928c2f45424812)
Diffstat (limited to 'source3/passdb/pdb_get_set.c')
-rw-r--r-- | source3/passdb/pdb_get_set.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c index 1505458551..9c2b7e4c70 100644 --- a/source3/passdb/pdb_get_set.c +++ b/source3/passdb/pdb_get_set.c @@ -314,12 +314,20 @@ uint32 pdb_get_unknown_3 (const SAM_ACCOUNT *sampass) return (-1); } -uint32 pdb_get_unknown_5 (const SAM_ACCOUNT *sampass) +uint16 pdb_get_bad_password_count(const SAM_ACCOUNT *sampass) { if (sampass) - return (sampass->private.unknown_5); + return (sampass->private.bad_password_count); else - return (-1); + return 0; +} + +uint16 pdb_get_logon_count(const SAM_ACCOUNT *sampass) +{ + if (sampass) + return (sampass->private.logon_count); + else + return 0; } uint32 pdb_get_unknown_6 (const SAM_ACCOUNT *sampass) @@ -984,14 +992,24 @@ BOOL pdb_set_unknown_3 (SAM_ACCOUNT *sampass, uint32 unkn, enum pdb_value_state return pdb_set_init_flags(sampass, PDB_UNKNOWN3, flag); } -BOOL pdb_set_unknown_5 (SAM_ACCOUNT *sampass, uint32 unkn, enum pdb_value_state flag) +BOOL pdb_set_bad_password_count(SAM_ACCOUNT *sampass, uint16 bad_password_count, enum pdb_value_state flag) +{ + if (!sampass) + return False; + + sampass->private.bad_password_count = bad_password_count; + + return pdb_set_init_flags(sampass, PDB_BAD_PASSWORD_COUNT, flag); +} + +BOOL pdb_set_logon_count(SAM_ACCOUNT *sampass, uint16 logon_count, enum pdb_value_state flag) { if (!sampass) return False; - sampass->private.unknown_5 = unkn; + sampass->private.logon_count = logon_count; - return pdb_set_init_flags(sampass, PDB_UNKNOWN5, flag); + return pdb_set_init_flags(sampass, PDB_LOGON_COUNT, flag); } BOOL pdb_set_unknown_6 (SAM_ACCOUNT *sampass, uint32 unkn, enum pdb_value_state flag) |