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_mysql.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_mysql.c')
-rw-r--r-- | source3/passdb/pdb_mysql.c | 16 |
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) |