summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2002-11-06 12:26:21 +0000
committerJelmer Vernooij <jelmer@samba.org>2002-11-06 12:26:21 +0000
commit809c4715da211df96482fb82427f0d3797119b7a (patch)
treecb7a30976ec6560ef886f5b8169901f67edf708d
parent5f119d4597fcd373ce56a4166b393098f3557edd (diff)
downloadsamba-809c4715da211df96482fb82427f0d3797119b7a.tar.gz
samba-809c4715da211df96482fb82427f0d3797119b7a.tar.bz2
samba-809c4715da211df96482fb82427f0d3797119b7a.zip
Adapt to latest pdb API changes - only thing left is group support
(This used to be commit 99a2e7fde1fd4e589035c273f40419ef322e097d)
-rw-r--r--source3/passdb/pdb_mysql.c23
-rw-r--r--source3/passdb/pdb_xml.c15
2 files changed, 17 insertions, 21 deletions
diff --git a/source3/passdb/pdb_mysql.c b/source3/passdb/pdb_mysql.c
index 15b091589c..ac26cc9051 100644
--- a/source3/passdb/pdb_mysql.c
+++ b/source3/passdb/pdb_mysql.c
@@ -656,7 +656,6 @@ static NTSTATUS mysqlsam_replace_sam_account(struct pdb_methods *methods,
const SAM_ACCOUNT * newpwd, char isupdate)
{
pstring temp;
- uint32 store = pdb_get_init_flag(newpwd);
struct pdb_mysql_data *data;
pdb_mysql_query query;
fstring sid_str;
@@ -695,7 +694,7 @@ static NTSTATUS mysqlsam_replace_sam_account(struct pdb_methods *methods,
CONFIG_ACCT_CTRL_DEFAULT),
pdb_get_acct_ctrl(newpwd));
- if (store & PDB_LOGONTIME) {
+ if (pdb_get_init_flags(newpwd, PDB_LOGONTIME) != PDB_DEFAULT) {
pdb_mysql_int_field(methods, &query,
config_value_write(data,
"logon time column",
@@ -703,7 +702,7 @@ static NTSTATUS mysqlsam_replace_sam_account(struct pdb_methods *methods,
pdb_get_logon_time(newpwd));
}
- if (store & PDB_LOGOFFTIME) {
+ if (pdb_get_init_flags(newpwd, PDB_LOGOFFTIME) != PDB_DEFAULT) {
pdb_mysql_int_field(methods, &query,
config_value_write(data,
"logoff time column",
@@ -711,7 +710,7 @@ static NTSTATUS mysqlsam_replace_sam_account(struct pdb_methods *methods,
pdb_get_logoff_time(newpwd));
}
- if (store & PDB_KICKOFFTIME) {
+ if (pdb_get_init_flags(newpwd, PDB_KICKOFFTIME) != PDB_DEFAULT) {
pdb_mysql_int_field(methods, &query,
config_value_write(data,
"kickoff time column",
@@ -719,7 +718,7 @@ static NTSTATUS mysqlsam_replace_sam_account(struct pdb_methods *methods,
pdb_get_kickoff_time(newpwd));
}
- if (store & PDB_CANCHANGETIME) {
+ if (pdb_get_init_flags(newpwd, PDB_CANCHANGETIME) != PDB_DEFAULT) {
pdb_mysql_int_field(methods, &query,
config_value_write(data,
"pass can change time column",
@@ -727,7 +726,7 @@ static NTSTATUS mysqlsam_replace_sam_account(struct pdb_methods *methods,
pdb_get_pass_can_change_time(newpwd));
}
- if (store & PDB_MUSTCHANGETIME) {
+ if (pdb_get_init_flags(newpwd, PDB_MUSTCHANGETIME) != PDB_DEFAULT) {
pdb_mysql_int_field(methods, &query,
config_value_write(data,
"pass must change time column",
@@ -759,14 +758,14 @@ static NTSTATUS mysqlsam_replace_sam_account(struct pdb_methods *methods,
pdb_get_logon_divs(newpwd));
}
- if (store & PDB_UID) {
+ if (pdb_get_init_flags(newpwd, PDB_UID) != PDB_DEFAULT) {
pdb_mysql_int_field(methods, &query,
config_value_write(data, "uid column",
CONFIG_UID_DEFAULT),
pdb_get_uid(newpwd));
}
- if (store & PDB_GID) {
+ if (pdb_get_init_flags(newpwd, PDB_GID) != PDB_DEFAULT) {
pdb_mysql_int_field(methods, &query,
config_value_write(data, "gid column",
CONFIG_GID_DEFAULT),
@@ -776,13 +775,13 @@ static NTSTATUS mysqlsam_replace_sam_account(struct pdb_methods *methods,
pdb_mysql_string_field(methods, &query,
config_value_write(data, "user sid column",
CONFIG_USER_SID_DEFAULT),
- sid_to_string(sid_str, (DOM_SID *)
+ sid_to_string(sid_str,
pdb_get_user_sid(newpwd)));
pdb_mysql_string_field(methods, &query,
config_value_write(data, "group sid column",
CONFIG_GROUP_SID_DEFAULT),
- sid_to_string(sid_str, (DOM_SID *)
+ sid_to_string(sid_str,
pdb_get_group_sid(newpwd)));
pdb_mysql_string_field(methods, &query,
@@ -861,9 +860,7 @@ static NTSTATUS mysqlsam_replace_sam_account(struct pdb_methods *methods,
config_value_read(data,
"user sid column",
CONFIG_USER_SID_DEFAULT),
- sid_to_string(sid_str, (DOM_SID *)
- pdb_get_user_sid
- (newpwd)));
+ sid_to_string(sid_str, pdb_get_user_sid (newpwd)));
} else {
query.part2[strlen(query.part2) - 1] = ')';
query.part1[strlen(query.part1) - 1] = ')';
diff --git a/source3/passdb/pdb_xml.c b/source3/passdb/pdb_xml.c
index 4a48600388..53e2e342ba 100644
--- a/source3/passdb/pdb_xml.c
+++ b/source3/passdb/pdb_xml.c
@@ -381,7 +381,6 @@ static NTSTATUS xmlsam_add_sam_account(struct pdb_methods *methods, SAM_ACCOUNT
fstring sid_str;
xmlNodePtr cur, user, pass, root;
pdb_xml *data;
- uint32 store = pdb_get_init_flag(u);
DEBUG(10, ("xmlsam_add_sam_account called!\n"));
@@ -409,7 +408,7 @@ static NTSTATUS xmlsam_add_sam_account(struct pdb_methods *methods, SAM_ACCOUNT
user = xmlNewChild(data->users, data->ns, "user", NULL);
xmlNewProp(user, "sid",
sid_to_string(sid_str, pdb_get_user_sid(u)));
- if (store & PDB_UID)
+ if (pdb_get_init_flags(u, PDB_UID) != PDB_DEFAULT)
xmlNewProp(user, "uid", iota(pdb_get_uid(u)));
if (pdb_get_username(u) && strcmp(pdb_get_username(u), ""))
@@ -419,18 +418,18 @@ static NTSTATUS xmlsam_add_sam_account(struct pdb_methods *methods, SAM_ACCOUNT
xmlNewProp(cur, "sid",
sid_to_string(sid_str, pdb_get_group_sid(u)));
- if (store & PDB_GID)
+ if (pdb_get_init_flags(u, PDB_GID) != PDB_DEFAULT)
xmlNewProp(cur, "gid", iota(pdb_get_gid(u)));
- if (store & PDB_LOGONTIME)
+ if (pdb_get_init_flags(u, PDB_LOGONTIME) != PDB_DEFAULT)
xmlNewChild(user, data->ns, "login_time",
iota(pdb_get_logon_time(u)));
- if (store & PDB_LOGOFFTIME)
+ if (pdb_get_init_flags(u, PDB_LOGOFFTIME) != PDB_DEFAULT)
xmlNewChild(user, data->ns, "logoff_time",
iota(pdb_get_logoff_time(u)));
- if (store & PDB_KICKOFFTIME)
+ if (pdb_get_init_flags(u, PDB_KICKOFFTIME) != PDB_DEFAULT)
xmlNewChild(user, data->ns, "kickoff_time",
iota(pdb_get_kickoff_time(u)));
@@ -475,11 +474,11 @@ static NTSTATUS xmlsam_add_sam_account(struct pdb_methods *methods, SAM_ACCOUNT
pass = xmlNewChild(user, data->ns, "password", NULL);
if (pdb_get_pass_last_set_time(u))
xmlNewProp(pass, "last_set", iota(pdb_get_pass_last_set_time(u)));
- if (store & PDB_CANCHANGETIME)
+ if (pdb_get_init_flags(u, PDB_CANCHANGETIME) != PDB_DEFAULT)
xmlNewProp(pass, "can_change",
iota(pdb_get_pass_can_change_time(u)));
- if (store & PDB_MUSTCHANGETIME)
+ if (pdb_get_init_flags(u, PDB_MUSTCHANGETIME) != PDB_DEFAULT)
xmlNewProp(pass, "must_change",
iota(pdb_get_pass_must_change_time(u)));