summaryrefslogtreecommitdiff
path: root/source3/passdb/pdb_xml.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-09-18 23:54:12 +0000
committerJeremy Allison <jra@samba.org>2003-09-18 23:54:12 +0000
commit30fd3599143260ee6893a5125e7ec7cec8bb2289 (patch)
treea35349d238a72e05fbc8871929013be8b910bcb4 /source3/passdb/pdb_xml.c
parent8e0a88b7e2f84175860225363ff17584e6e1ddd4 (diff)
downloadsamba-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_xml.c')
-rw-r--r--source3/passdb/pdb_xml.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/passdb/pdb_xml.c b/source3/passdb/pdb_xml.c
index 7af2fdd940..29922bca4f 100644
--- a/source3/passdb/pdb_xml.c
+++ b/source3/passdb/pdb_xml.c
@@ -159,8 +159,13 @@ static BOOL parseUser(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SAM_ACCOUNT *
atol(xmlNodeListGetString
(doc, cur->xmlChildrenNode, 1)), PDB_SET);
- else if (!strcmp(cur->name, "unknown_5") && cur->ns == ns)
- pdb_set_unknown_5(u,
+ else if (!strcmp(cur->name, "bad_password_count") && cur->ns == ns)
+ pdb_set_bad_password_count(u,
+ atol(xmlNodeListGetString
+ (doc, cur->xmlChildrenNode, 1)), PDB_SET);
+
+ else if (!strcmp(cur->name, "logon_count") && cur->ns == ns)
+ pdb_set_logon_count(u,
atol(xmlNodeListGetString
(doc, cur->xmlChildrenNode, 1)), PDB_SET);
@@ -495,7 +500,8 @@ static NTSTATUS xmlsam_add_sam_account(struct pdb_methods *methods, SAM_ACCOUNT
xmlNewChild(user, data->ns, "hours_len",
iota(pdb_get_hours_len(u)));
- xmlNewChild(user, data->ns, "unknown_5", iota(pdb_get_unknown_5(u)));
+ xmlNewChild(user, data->ns, "bad_password_count", iota(pdb_get_bad_password_count(u)));
+ xmlNewChild(user, data->ns, "logon_count", iota(pdb_get_logon_count(u)));
xmlNewChild(user, data->ns, "unknown_6", iota(pdb_get_unknown_6(u)));
xmlSaveFile(data->location, data->doc);