summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/passdb.c20
-rw-r--r--source3/passdb/pdb_get_set.c26
-rw-r--r--source3/passdb/pdb_gums.c7
-rw-r--r--source3/passdb/pdb_ldap.c2
-rw-r--r--source3/passdb/pdb_mysql.c1
-rw-r--r--source3/passdb/pdb_pgsql.c1
-rw-r--r--source3/passdb/pdb_sql.c3
-rw-r--r--source3/passdb/pdb_xml.c6
8 files changed, 22 insertions, 44 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index 8fbd8d4cdc..52dee801ad 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -79,7 +79,7 @@ void pdb_fill_default_sam(SAM_ACCOUNT *user)
user->private.logoff_time =
user->private.kickoff_time =
user->private.pass_must_change_time = get_time_t_max();
- user->private.unknown_3 = 0x00ffffff; /* don't know */
+ user->private.fields_present = 0x00ffffff; /* don't know */
user->private.logon_divs = 168; /* hours per week */
user->private.hours_len = 21; /* 21 times 8 bits = 168 */
memset(user->private.hours, 0xff, user->private.hours_len); /* available at all hours */
@@ -1346,7 +1346,7 @@ BOOL init_sam_from_buffer_v0(SAM_ACCOUNT *sampass, uint8 *buf, uint32 buflen)
fullname_len, homedir_len, logon_script_len,
profile_path_len, acct_desc_len, workstations_len;
- uint32 user_rid, group_rid, unknown_3, hours_len, unknown_6;
+ uint32 user_rid, group_rid, remove_me, hours_len, unknown_6;
uint16 acct_ctrl, logon_divs;
uint16 bad_password_count, logon_count;
uint8 *hours;
@@ -1385,7 +1385,7 @@ BOOL init_sam_from_buffer_v0(SAM_ACCOUNT *sampass, uint8 *buf, uint32 buflen)
&lm_pw_len, &lm_pw_ptr,
&nt_pw_len, &nt_pw_ptr,
&acct_ctrl,
- &unknown_3,
+ &remove_me, /* remove on the next TDB_FORMAT upgarde */
&logon_divs,
&hours_len,
&hourslen, &hours,
@@ -1463,7 +1463,6 @@ BOOL init_sam_from_buffer_v0(SAM_ACCOUNT *sampass, uint8 *buf, uint32 buflen)
pdb_set_user_sid_from_rid(sampass, user_rid, PDB_SET);
pdb_set_group_sid_from_rid(sampass, group_rid, PDB_SET);
- pdb_set_unknown_3(sampass, unknown_3, PDB_SET);
pdb_set_hours_len(sampass, hours_len, PDB_SET);
pdb_set_bad_password_count(sampass, bad_password_count, PDB_SET);
pdb_set_logon_count(sampass, logon_count, PDB_SET);
@@ -1667,7 +1666,7 @@ uint32 init_buffer_from_sam_v0 (uint8 **buf, const SAM_ACCOUNT *sampass, BOOL si
lm_pw_len, lm_pw,
nt_pw_len, nt_pw,
pdb_get_acct_ctrl(sampass),
- pdb_get_unknown_3(sampass),
+ 0, /* was: fileds_present, to be removed on format change */
pdb_get_logon_divs(sampass),
pdb_get_hours_len(sampass),
MAX_HOURS_LEN, pdb_get_hours(sampass),
@@ -1710,7 +1709,7 @@ uint32 init_buffer_from_sam_v0 (uint8 **buf, const SAM_ACCOUNT *sampass, BOOL si
lm_pw_len, lm_pw,
nt_pw_len, nt_pw,
pdb_get_acct_ctrl(sampass),
- pdb_get_unknown_3(sampass),
+ 0, /* was: fileds_present, to be removed on format change */
pdb_get_logon_divs(sampass),
pdb_get_hours_len(sampass),
MAX_HOURS_LEN, pdb_get_hours(sampass),
@@ -1762,7 +1761,7 @@ BOOL init_sam_from_buffer_v1(SAM_ACCOUNT *sampass, uint8 *buf, uint32 buflen)
fullname_len, homedir_len, logon_script_len,
profile_path_len, acct_desc_len, workstations_len;
- uint32 user_rid, group_rid, unknown_3, hours_len, unknown_6;
+ uint32 user_rid, group_rid, remove_me, hours_len, unknown_6;
uint16 acct_ctrl, logon_divs;
uint16 bad_password_count, logon_count;
uint8 *hours;
@@ -1802,7 +1801,7 @@ BOOL init_sam_from_buffer_v1(SAM_ACCOUNT *sampass, uint8 *buf, uint32 buflen)
&lm_pw_len, &lm_pw_ptr,
&nt_pw_len, &nt_pw_ptr,
&acct_ctrl,
- &unknown_3,
+ &remove_me,
&logon_divs,
&hours_len,
&hourslen, &hours,
@@ -1880,7 +1879,6 @@ BOOL init_sam_from_buffer_v1(SAM_ACCOUNT *sampass, uint8 *buf, uint32 buflen)
pdb_set_user_sid_from_rid(sampass, user_rid, PDB_SET);
pdb_set_group_sid_from_rid(sampass, group_rid, PDB_SET);
- pdb_set_unknown_3(sampass, unknown_3, PDB_SET);
pdb_set_hours_len(sampass, hours_len, PDB_SET);
pdb_set_bad_password_count(sampass, bad_password_count, PDB_SET);
pdb_set_logon_count(sampass, logon_count, PDB_SET);
@@ -2087,7 +2085,7 @@ uint32 init_buffer_from_sam_v1 (uint8 **buf, const SAM_ACCOUNT *sampass, BOOL si
lm_pw_len, lm_pw,
nt_pw_len, nt_pw,
pdb_get_acct_ctrl(sampass),
- pdb_get_unknown_3(sampass),
+ 0,
pdb_get_logon_divs(sampass),
pdb_get_hours_len(sampass),
MAX_HOURS_LEN, pdb_get_hours(sampass),
@@ -2131,7 +2129,7 @@ uint32 init_buffer_from_sam_v1 (uint8 **buf, const SAM_ACCOUNT *sampass, BOOL si
lm_pw_len, lm_pw,
nt_pw_len, nt_pw,
pdb_get_acct_ctrl(sampass),
- pdb_get_unknown_3(sampass),
+ 0,
pdb_get_logon_divs(sampass),
pdb_get_hours_len(sampass),
MAX_HOURS_LEN, pdb_get_hours(sampass),
diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c
index 4a5a5759d4..11df0ad56d 100644
--- a/source3/passdb/pdb_get_set.c
+++ b/source3/passdb/pdb_get_set.c
@@ -306,14 +306,6 @@ const char* pdb_get_munged_dial (const SAM_ACCOUNT *sampass)
return (NULL);
}
-uint32 pdb_get_unknown_3 (const SAM_ACCOUNT *sampass)
-{
- if (sampass)
- return (sampass->private.unknown_3);
- else
- return (-1);
-}
-
uint16 pdb_get_bad_password_count(const SAM_ACCOUNT *sampass)
{
if (sampass)
@@ -982,16 +974,6 @@ BOOL pdb_set_plaintext_pw_only (SAM_ACCOUNT *sampass, const char *password, enum
return pdb_set_init_flags(sampass, PDB_PLAINTEXT_PW, flag);
}
-BOOL pdb_set_unknown_3 (SAM_ACCOUNT *sampass, uint32 unkn, enum pdb_value_state flag)
-{
- if (!sampass)
- return False;
-
- sampass->private.unknown_3 = unkn;
-
- return pdb_set_init_flags(sampass, PDB_UNKNOWN3, flag);
-}
-
BOOL pdb_set_bad_password_count(SAM_ACCOUNT *sampass, uint16 bad_password_count, enum pdb_value_state flag)
{
if (!sampass)
@@ -1128,3 +1110,11 @@ BOOL pdb_set_plaintext_passwd (SAM_ACCOUNT *sampass, const char *plaintext)
return True;
}
+
+/* check for any PDB_SET/CHANGED field and fill the appropriate mask bit */
+uint32 pdb_build_fields_present (SAM_ACCOUNT *sampass)
+{
+ /* value set to all for testing */
+ return 0x00ffffff;
+}
+
diff --git a/source3/passdb/pdb_gums.c b/source3/passdb/pdb_gums.c
index 25dc565253..c595a51e55 100644
--- a/source3/passdb/pdb_gums.c
+++ b/source3/passdb/pdb_gums.c
@@ -1,7 +1,12 @@
/*
+<<<<<<< pdb_gums.c
+ * 'Gums' password backend for samba
+ * Copyright (C) Simo Sorce 2003
+=======
* GUMS password backend for samba
* Copyright (C) Jelmer Vernooij 2002
* Copyright (C) Andrew Bartlett 2003
+>>>>>>> 1.4
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
@@ -95,7 +100,6 @@ static NTSTATUS gums_object_to_sam_account(SAM_ACCOUNT *sa, GUMS_OBJECT *go)
}
data_blob_clear_free(&pwd);
- BOOL_SET_OR_FAIL(pdb_set_unknown_3(sa, gums_get_user_unknown_3(go), PDB_SET), error);
BOOL_SET_OR_FAIL(pdb_set_bad_password_count(sa, gums_get_user_bad_password_count(go), PDB_SET), error);
BOOL_SET_OR_FAIL(pdb_set_unknown_6(sa, gums_get_user_unknown_6(go), PDB_SET), error);
BOOL_SET_OR_FAIL(pdb_set_hours(sa, gums_get_user_hours(go), PDB_SET), error);
@@ -155,7 +159,6 @@ static NTSTATUS sam_account_to_gums_object(GUMS_OBJECT *go, SAM_ACCOUNT *sa)
SET_OR_FAIL(gums_set_user_logon_divs(go, pdb_get_logon_divs(sa)), error);
if (pdb_get_hours(sa))
SET_OR_FAIL(gums_set_user_hours(go, pdb_get_hours_len(sa), pdb_get_hours(sa)), error);
- SET_OR_FAIL(gums_set_user_unknown_3(go, pdb_get_unknown_3(sa)), error);
SET_OR_FAIL(gums_set_user_bad_password_count(go, pdb_get_bad_password_count(sa)), error);
SET_OR_FAIL(gums_set_user_unknown_6(go, pdb_get_unknown_6(sa)), error);
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 6e8ff83507..ff2b5cf762 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -712,8 +712,6 @@ 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); */
-
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 */
diff --git a/source3/passdb/pdb_mysql.c b/source3/passdb/pdb_mysql.c
index acc1eff829..deed27dbe4 100644
--- a/source3/passdb/pdb_mysql.c
+++ b/source3/passdb/pdb_mysql.c
@@ -111,7 +111,6 @@ static NTSTATUS row_to_sam_account(MYSQL_RES * r, SAM_ACCOUNT * u)
pdb_set_plaintext_passwd(u, row[22]);
pdb_set_acct_ctrl(u, xatol(row[23]), PDB_SET);
- 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_bad_password_count(u, xatol(row[27]), PDB_SET);
diff --git a/source3/passdb/pdb_pgsql.c b/source3/passdb/pdb_pgsql.c
index 61c620e092..1731c720a2 100644
--- a/source3/passdb/pdb_pgsql.c
+++ b/source3/passdb/pdb_pgsql.c
@@ -98,7 +98,6 @@ static NTSTATUS row_to_sam_account ( PGresult *r, long row, SAM_ACCOUNT *u )
pdb_set_munged_dial ( u, PQgetvalue( r, row, 17 ), PDB_SET ) ;
pdb_set_acct_ctrl ( u, PQgetlong ( r, row, 23 ), PDB_SET ) ;
- pdb_set_unknown_3 ( u, PQgetlong ( r, row, 24 ), PDB_SET ) ;
pdb_set_logon_divs ( u, PQgetlong ( r, row, 25 ), PDB_SET ) ;
pdb_set_hours_len ( u, PQgetlong ( r, row, 26 ), PDB_SET ) ;
pdb_set_logon_count ( u, PQgetlong ( r, row, 27 ), PDB_SET ) ;
diff --git a/source3/passdb/pdb_sql.c b/source3/passdb/pdb_sql.c
index b87004e019..d3e8b90a85 100644
--- a/source3/passdb/pdb_sql.c
+++ b/source3/passdb/pdb_sql.c
@@ -44,7 +44,6 @@
#define CONFIG_NT_PW_DEFAULT "nt_pw"
#define CONFIG_PLAIN_PW_DEFAULT "NULL"
#define CONFIG_ACCT_CTRL_DEFAULT "acct_ctrl"
-#define CONFIG_UNKNOWN_3_DEFAULT "unknown_3"
#define CONFIG_LOGON_DIVS_DEFAULT "logon_divs"
#define CONFIG_HOURS_LEN_DEFAULT "hours_len"
#define CONFIG_BAD_PASSWORD_COUNT_DEFAULT "bad_password_count"
@@ -254,8 +253,6 @@ char *sql_account_query_select(const char *data, BOOL update, enum sql_search_fi
CONFIG_PLAIN_PW_DEFAULT),
config_value_read(data, "acct ctrl column",
CONFIG_ACCT_CTRL_DEFAULT),
- config_value_read(data, "unknown 3 column",
- CONFIG_UNKNOWN_3_DEFAULT),
config_value_read(data, "logon divs column",
CONFIG_LOGON_DIVS_DEFAULT),
config_value_read(data, "hours len column",
diff --git a/source3/passdb/pdb_xml.c b/source3/passdb/pdb_xml.c
index 19998a6655..2738ad40e2 100644
--- a/source3/passdb/pdb_xml.c
+++ b/source3/passdb/pdb_xml.c
@@ -154,11 +154,6 @@ 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_3") && cur->ns == ns)
- pdb_set_unknown_3(u,
- atol(xmlNodeListGetString
- (doc, cur->xmlChildrenNode, 1)), PDB_SET);
-
else if (!strcmp(cur->name, "bad_password_count") && cur->ns == ns)
pdb_set_bad_password_count(u,
atol(xmlNodeListGetString
@@ -490,7 +485,6 @@ static NTSTATUS xmlsam_add_sam_account(struct pdb_methods *methods, SAM_ACCOUNT
}
xmlNewChild(user, data->ns, "acct_ctrl", iota(pdb_get_acct_ctrl(u)));
- xmlNewChild(user, data->ns, "unknown_3", iota(pdb_get_unknown_3(u)));
if (pdb_get_logon_divs(u))
xmlNewChild(user, data->ns, "logon_divs",