diff options
author | Jeremy Allison <jra@samba.org> | 2003-09-18 23:53:48 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-09-18 23:53:48 +0000 |
commit | 3a48e4b2875a6cb1c143377d7f6fb0be50ea80d2 (patch) | |
tree | e358ab2294ac4f6adda55b4e02ef2f1f8748b065 /source3/passdb/pdb_ldap.c | |
parent | d4df20e96f87a55b80a66b3ff588122125cf0cec (diff) | |
download | samba-3a48e4b2875a6cb1c143377d7f6fb0be50ea80d2.tar.gz samba-3a48e4b2875a6cb1c143377d7f6fb0be50ea80d2.tar.bz2 samba-3a48e4b2875a6cb1c143377d7f6fb0be50ea80d2.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 cd7bd8c2daff3293d48f3376a7c5a708a140fd94)
Diffstat (limited to 'source3/passdb/pdb_ldap.c')
-rw-r--r-- | source3/passdb/pdb_ldap.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index e00631fb7d..d4de6b2e96 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -422,6 +422,8 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, smbntpwd[NT_HASH_LEN]; uint16 acct_ctrl = 0, logon_divs; + uint16 bad_password_count = 0, + logon_count = 0; uint32 hours_len; uint8 hours[MAX_HOURS_LEN]; pstring temp; @@ -704,7 +706,23 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, pdb_set_munged_dial(sampass, munged_dial, PDB_SET); /* pdb_set_unknown_3(sampass, unknown3, PDB_SET); */ - /* pdb_set_unknown_5(sampass, unknown5, PDB_SET); */ + + if (!smbldap_get_single_attribute(ldap_state->smbldap_state->ldap_struct, entry, + get_userattr_key2string(ldap_state->schema_ver, LDAP_ATTR_BAD_PASSWORD_COUNT), temp)) { + /* leave as default */ + } else { + bad_password_count = (uint32) atol(temp); + pdb_set_bad_password_count(sampass, bad_password_count, PDB_SET); + } + + if (!smbldap_get_single_attribute(ldap_state->smbldap_state->ldap_struct, entry, + get_userattr_key2string(ldap_state->schema_ver, LDAP_ATTR_LOGON_COUNT), temp)) { + /* leave as default */ + } else { + logon_count = (uint32) atol(temp); + pdb_set_logon_count(sampass, logon_count, PDB_SET); + } + /* pdb_set_unknown_6(sampass, unknown6, PDB_SET); */ pdb_set_hours(sampass, hours, PDB_SET); |