summaryrefslogtreecommitdiff
path: root/source3/passdb/pdb_mysql.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-09-18 23:53:48 +0000
committerJeremy Allison <jra@samba.org>2003-09-18 23:53:48 +0000
commit3a48e4b2875a6cb1c143377d7f6fb0be50ea80d2 (patch)
treee358ab2294ac4f6adda55b4e02ef2f1f8748b065 /source3/passdb/pdb_mysql.c
parentd4df20e96f87a55b80a66b3ff588122125cf0cec (diff)
downloadsamba-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_mysql.c')
-rw-r--r--source3/passdb/pdb_mysql.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source3/passdb/pdb_mysql.c b/source3/passdb/pdb_mysql.c
index 6c200be504..460e260ddc 100644
--- a/source3/passdb/pdb_mysql.c
+++ b/source3/passdb/pdb_mysql.c
@@ -49,7 +49,8 @@
#define CONFIG_UNKNOWN_3_DEFAULT "unknown_3"
#define CONFIG_LOGON_DIVS_DEFAULT "logon_divs"
#define CONFIG_HOURS_LEN_DEFAULT "hours_len"
-#define CONFIG_UNKNOWN_5_DEFAULT "unknown_5"
+#define CONFIG_BAD_PASSWORD_COUNT_DEFAULT "bad_password_count"
+#define CONFIG_LOGON_COUNT_DEFAULT "logon_count"
#define CONFIG_UNKNOWN_6_DEFAULT "unknown_6"
#define CONFIG_HOST_DEFAULT "localhost"
#define CONFIG_USER_DEFAULT "samba"
@@ -259,8 +260,9 @@ static NTSTATUS row_to_sam_account(MYSQL_RES * r, SAM_ACCOUNT * u)
pdb_set_unknown_3(u, xatol(row[24]), PDB_SET);
pdb_set_logon_divs(u, xatol(row[25]), PDB_SET);
pdb_set_hours_len(u, xatol(row[26]), PDB_SET);
- pdb_set_unknown_5(u, xatol(row[27]), PDB_SET);
- pdb_set_unknown_6(u, xatol(row[28]), PDB_SET);
+ pdb_set_bad_password_count(u, xatol(row[27]), PDB_SET);
+ pdb_set_logon_count(u, xatol(row[28]), PDB_SET);
+ pdb_set_unknown_6(u, xatol(row[29]), PDB_SET);
return NT_STATUS_OK;
}
@@ -278,7 +280,7 @@ static NTSTATUS mysqlsam_setsampwent(struct pdb_methods *methods, BOOL update)
}
asprintf(&query,
- "SELECT %s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s FROM %s",
+ "SELECT %s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s FROM %s",
config_value_read(data, "logon time column",
CONFIG_LOGON_TIME_DEFAULT),
config_value_read(data, "logoff time column",
@@ -333,8 +335,10 @@ static NTSTATUS mysqlsam_setsampwent(struct pdb_methods *methods, BOOL update)
CONFIG_LOGON_DIVS_DEFAULT),
config_value_read(data, "hours len column",
CONFIG_HOURS_LEN_DEFAULT),
- config_value_read(data, "unknown 5 column",
- CONFIG_UNKNOWN_5_DEFAULT),
+ config_value_read(data, "bad_password_count column",
+ CONFIG_BAD_PASSWORD_COUNT_DEFAULT),
+ config_value_read(data, "logon_count column",
+ CONFIG_LOGON_COUNT_DEFAULT),
config_value_read(data, "unknown 6 column",
CONFIG_UNKNOWN_6_DEFAULT),
config_value(data, "table", CONFIG_TABLE_DEFAULT)