summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2002-11-04 14:36:34 +0000
committerJelmer Vernooij <jelmer@samba.org>2002-11-04 14:36:34 +0000
commit366da1ee377e279d57e247667f02818aca935b30 (patch)
treec6df8dcf8f8ca776b2ba15137c3ef0a807c16c15
parent7da7b4a464758a53dd6b1b8a55d3e26bc8f5e402 (diff)
downloadsamba-366da1ee377e279d57e247667f02818aca935b30.tar.gz
samba-366da1ee377e279d57e247667f02818aca935b30.tar.bz2
samba-366da1ee377e279d57e247667f02818aca935b30.zip
Adapt to metze's PDB_SET patch
(This used to be commit 33c7a296b3bdfab276ed91ea77077eedbeed3757)
-rw-r--r--examples/pdb/mysql/pdb_mysql.c60
-rw-r--r--examples/pdb/xml/pdb_xml.c56
2 files changed, 58 insertions, 58 deletions
diff --git a/examples/pdb/mysql/pdb_mysql.c b/examples/pdb/mysql/pdb_mysql.c
index c73d3716fe..207c3d124e 100644
--- a/examples/pdb/mysql/pdb_mysql.c
+++ b/examples/pdb/mysql/pdb_mysql.c
@@ -229,48 +229,48 @@ static NTSTATUS row_to_sam_account(MYSQL_RES * r, SAM_ACCOUNT * u)
pdb_set_logon_time(u, xatol(row[0]), FALSE);
pdb_set_logoff_time(u, xatol(row[1]), FALSE);
pdb_set_kickoff_time(u, xatol(row[2]), FALSE);
- pdb_set_pass_last_set_time(u, xatol(row[3]));
+ pdb_set_pass_last_set_time(u, xatol(row[3]), PDB_SET);
pdb_set_pass_can_change_time(u, xatol(row[4]), FALSE);
pdb_set_pass_must_change_time(u, xatol(row[5]), FALSE);
- pdb_set_username(u, row[6]);
- pdb_set_domain(u, row[7]);
- pdb_set_nt_username(u, row[8]);
- pdb_set_fullname(u, row[9]);
+ pdb_set_username(u, row[6], PDB_SET);
+ pdb_set_domain(u, row[7], PDB_SET);
+ pdb_set_nt_username(u, row[8], PDB_SET);
+ pdb_set_fullname(u, row[9], PDB_SET);
pdb_set_homedir(u, row[10], True);
pdb_set_dir_drive(u, row[11], True);
pdb_set_logon_script(u, row[12], True);
pdb_set_profile_path(u, row[13], True);
- pdb_set_acct_desc(u, row[14]);
- pdb_set_workstations(u, row[15]);
- pdb_set_unknown_str(u, row[16]);
- pdb_set_munged_dial(u, row[17]);
+ pdb_set_acct_desc(u, row[14], PDB_SET);
+ pdb_set_workstations(u, row[15], PDB_SET);
+ pdb_set_unknown_str(u, row[16], PDB_SET);
+ pdb_set_munged_dial(u, row[17], PDB_SET);
if (row[18])
- pdb_set_uid(u, xatol(row[18]));
+ pdb_set_uid(u, xatol(row[18]), PDB_SET);
if (row[19])
- pdb_set_gid(u, xatol(row[19]));
+ pdb_set_gid(u, xatol(row[19]), PDB_SET);
string_to_sid(&sid, row[20]);
- pdb_set_user_sid(u, &sid);
+ pdb_set_user_sid(u, &sid, PDB_SET);
string_to_sid(&sid, row[21]);
- pdb_set_group_sid(u, &sid);
+ pdb_set_group_sid(u, &sid, PDB_SET);
- if (pdb_gethexpwd(row[22], temp))
- pdb_set_lanman_passwd(u, temp);
- if (pdb_gethexpwd(row[23], temp))
- pdb_set_nt_passwd(u, temp);
+ if (pdb_gethexpwd(row[22], temp), PDB_SET)
+ pdb_set_lanman_passwd(u, temp, PDB_SET);
+ if (pdb_gethexpwd(row[23], temp), PDB_SET)
+ pdb_set_nt_passwd(u, temp, PDB_SET);
/* Only use plaintext password storage when lanman and nt are
* NOT used */
if (!row[22] || !row[23])
pdb_set_plaintext_passwd(u, row[24]);
- pdb_set_acct_ctrl(u, xatol(row[25]));
- pdb_set_unknown_3(u, xatol(row[26]));
- pdb_set_logon_divs(u, xatol(row[27]));
- pdb_set_hours_len(u, xatol(row[28]));
- pdb_set_unknown_5(u, xatol(row[29]));
- pdb_set_unknown_6(u, xatol(row[30]));
+ pdb_set_acct_ctrl(u, xatol(row[25]), PDB_SET);
+ pdb_set_unknown_3(u, xatol(row[26]), PDB_SET);
+ pdb_set_logon_divs(u, xatol(row[27]), PDB_SET);
+ pdb_set_hours_len(u, xatol(row[28]), PDB_SET);
+ pdb_set_unknown_5(u, xatol(row[29]), PDB_SET);
+ pdb_set_unknown_6(u, xatol(row[30]), PDB_SET);
return NT_STATUS_OK;
}
@@ -695,7 +695,7 @@ static NTSTATUS mysqlsam_replace_sam_account(struct pdb_methods *methods,
CONFIG_ACCT_CTRL_DEFAULT),
pdb_get_acct_ctrl(newpwd));
- if (store & FLAG_SAM_LOGONTIME) {
+ if (store & PDB_LOGONTIME) {
pdb_mysql_int_field(methods, &query,
config_value_write(data,
"logon time column",
@@ -703,7 +703,7 @@ static NTSTATUS mysqlsam_replace_sam_account(struct pdb_methods *methods,
pdb_get_logon_time(newpwd));
}
- if (store & FLAG_SAM_LOGOFFTIME) {
+ if (store & PDB_LOGOFFTIME) {
pdb_mysql_int_field(methods, &query,
config_value_write(data,
"logoff time column",
@@ -711,7 +711,7 @@ static NTSTATUS mysqlsam_replace_sam_account(struct pdb_methods *methods,
pdb_get_logoff_time(newpwd));
}
- if (store & FLAG_SAM_KICKOFFTIME) {
+ if (store & PDB_KICKOFFTIME) {
pdb_mysql_int_field(methods, &query,
config_value_write(data,
"kickoff time column",
@@ -719,7 +719,7 @@ static NTSTATUS mysqlsam_replace_sam_account(struct pdb_methods *methods,
pdb_get_kickoff_time(newpwd));
}
- if (store & FLAG_SAM_CANCHANGETIME) {
+ if (store & PDB_CANCHANGETIME) {
pdb_mysql_int_field(methods, &query,
config_value_write(data,
"pass can change time column",
@@ -727,7 +727,7 @@ static NTSTATUS mysqlsam_replace_sam_account(struct pdb_methods *methods,
pdb_get_pass_can_change_time(newpwd));
}
- if (store & FLAG_SAM_MUSTCHANGETIME) {
+ if (store & PDB_MUSTCHANGETIME) {
pdb_mysql_int_field(methods, &query,
config_value_write(data,
"pass must change time column",
@@ -759,14 +759,14 @@ static NTSTATUS mysqlsam_replace_sam_account(struct pdb_methods *methods,
pdb_get_logon_divs(newpwd));
}
- if (store & FLAG_SAM_UID) {
+ if (store & PDB_UID) {
pdb_mysql_int_field(methods, &query,
config_value_write(data, "uid column",
CONFIG_UID_DEFAULT),
pdb_get_uid(newpwd));
}
- if (store & FLAG_SAM_GID) {
+ if (store & PDB_GID) {
pdb_mysql_int_field(methods, &query,
config_value_write(data, "gid column",
CONFIG_GID_DEFAULT),
diff --git a/examples/pdb/xml/pdb_xml.c b/examples/pdb/xml/pdb_xml.c
index 5de27bc6e2..be074fca03 100644
--- a/examples/pdb/xml/pdb_xml.c
+++ b/examples/pdb/xml/pdb_xml.c
@@ -55,12 +55,12 @@ BOOL parsePass(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SAM_ACCOUNT * u)
&&
pdb_gethexpwd(xmlNodeListGetString
(doc, cur->xmlChildrenNode, 1), temp))
- pdb_set_nt_passwd(u, temp);
+ pdb_set_nt_passwd(u, temp, PDB_SET);
else if (!strcmp(xmlGetProp(cur, "type"), "lanman")
&&
pdb_gethexpwd(xmlNodeListGetString
(doc, cur->xmlChildrenNode, 1), temp))
- pdb_set_lanman_passwd(u, temp);
+ pdb_set_lanman_passwd(u, temp, PDB_SET);
else
DEBUG(0,
("Unknown crypt type: %s\n",
@@ -79,42 +79,42 @@ BOOL parseUser(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SAM_ACCOUNT * u)
tmp = xmlGetProp(cur, "sid");
if (tmp){
string_to_sid(&sid, tmp);
- pdb_set_user_sid(u, &sid);
+ pdb_set_user_sid(u, &sid, PDB_SET);
}
tmp = xmlGetProp(cur, "uid");
if (tmp)
- pdb_set_uid(u, atol(tmp));
- pdb_set_username(u, xmlGetProp(cur, "name"));
+ pdb_set_uid(u, atol(tmp), PDB_SET);
+ pdb_set_username(u, xmlGetProp(cur, "name"), PDB_SET);
/* We don't care what the top level element name is */
cur = cur->xmlChildrenNode;
while (cur != NULL) {
if ((!strcmp(cur->name, "group")) && (cur->ns == ns)) {
tmp = xmlGetProp(cur, "gid");
if (tmp)
- pdb_set_gid(u, atol(tmp));
+ pdb_set_gid(u, atol(tmp), PDB_SET);
tmp = xmlGetProp(cur, "sid");
if (tmp){
string_to_sid(&sid, tmp);
- pdb_set_group_sid(u, &sid);
+ pdb_set_group_sid(u, &sid, PDB_SET);
}
}
else if ((!strcmp(cur->name, "domain")) && (cur->ns == ns))
pdb_set_domain(u,
xmlNodeListGetString(doc, cur->xmlChildrenNode,
- 1));
+ 1), PDB_SET);
else if (!strcmp(cur->name, "fullname") && cur->ns == ns)
pdb_set_fullname(u,
xmlNodeListGetString(doc,
cur->xmlChildrenNode,
- 1));
+ 1), PDB_SET);
else if (!strcmp(cur->name, "nt_username") && cur->ns == ns)
pdb_set_nt_username(u,
xmlNodeListGetString(doc,
cur->xmlChildrenNode,
- 1));
+ 1), PDB_SET);
else if (!strcmp(cur->name, "logon_script") && cur->ns == ns)
pdb_set_logon_script(u,
@@ -148,27 +148,27 @@ BOOL parseUser(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SAM_ACCOUNT * u)
else if (!strcmp(cur->name, "logon_divs") && cur->ns == ns)
pdb_set_logon_divs(u,
atol(xmlNodeListGetString
- (doc, cur->xmlChildrenNode, 1)));
+ (doc, cur->xmlChildrenNode, 1)), PDB_SET);
else if (!strcmp(cur->name, "hours_len") && cur->ns == ns)
pdb_set_hours_len(u,
atol(xmlNodeListGetString
- (doc, cur->xmlChildrenNode, 1)));
+ (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)));
+ (doc, cur->xmlChildrenNode, 1)), PDB_SET);
else if (!strcmp(cur->name, "unknown_5") && cur->ns == ns)
pdb_set_unknown_5(u,
atol(xmlNodeListGetString
- (doc, cur->xmlChildrenNode, 1)));
+ (doc, cur->xmlChildrenNode, 1)), PDB_SET);
else if (!strcmp(cur->name, "unknown_6") && cur->ns == ns)
pdb_set_unknown_6(u,
atol(xmlNodeListGetString
- (doc, cur->xmlChildrenNode, 1)));
+ (doc, cur->xmlChildrenNode, 1)), PDB_SET);
else if (!strcmp(cur->name, "homedir") && cur->ns == ns)
pdb_set_homedir(u,
@@ -179,7 +179,7 @@ BOOL parseUser(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SAM_ACCOUNT * u)
pdb_set_unknown_str(u,
xmlNodeListGetString(doc,
cur->xmlChildrenNode,
- 1));
+ 1), PDB_SET);
else if (!strcmp(cur->name, "dir_drive") && cur->ns == ns)
pdb_set_dir_drive(u,
@@ -191,29 +191,29 @@ BOOL parseUser(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SAM_ACCOUNT * u)
pdb_set_munged_dial(u,
xmlNodeListGetString(doc,
cur->xmlChildrenNode,
- 1));
+ 1), PDB_SET);
else if (!strcmp(cur->name, "acct_desc") && cur->ns == ns)
pdb_set_acct_desc(u,
xmlNodeListGetString(doc,
cur->xmlChildrenNode,
- 1));
+ 1), PDB_SET);
else if (!strcmp(cur->name, "acct_ctrl") && cur->ns == ns)
pdb_set_acct_ctrl(u,
atol(xmlNodeListGetString
- (doc, cur->xmlChildrenNode, 1)));
+ (doc, cur->xmlChildrenNode, 1)), PDB_SET);
else if (!strcmp(cur->name, "workstations") && cur->ns == ns)
pdb_set_workstations(u,
xmlNodeListGetString(doc,
cur->xmlChildrenNode,
- 1));
+ 1), PDB_SET);
else if ((!strcmp(cur->name, "password")) && (cur->ns == ns)) {
tmp = xmlGetProp(cur, "last_set");
if (tmp)
- pdb_set_pass_last_set_time(u, atol(tmp));
+ pdb_set_pass_last_set_time(u, atol(tmp), PDB_SET);
tmp = xmlGetProp(cur, "must_change");
if (tmp)
pdb_set_pass_must_change_time(u, atol(tmp), True);
@@ -402,7 +402,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 & FLAG_SAM_UID)
+ if (store & PDB_UID)
xmlNewProp(user, "uid", iota(pdb_get_uid(u)));
if (pdb_get_username(u) && strcmp(pdb_get_username(u), ""))
@@ -412,18 +412,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 & FLAG_SAM_GID)
+ if (store & PDB_GID)
xmlNewProp(cur, "gid", iota(pdb_get_gid(u)));
- if (store & FLAG_SAM_LOGONTIME)
+ if (store & PDB_LOGONTIME)
xmlNewChild(user, data->ns, "login_time",
iota(pdb_get_logon_time(u)));
- if (store & FLAG_SAM_LOGOFFTIME)
+ if (store & PDB_LOGOFFTIME)
xmlNewChild(user, data->ns, "logoff_time",
iota(pdb_get_logoff_time(u)));
- if (store & FLAG_SAM_KICKOFFTIME)
+ if (store & PDB_KICKOFFTIME)
xmlNewChild(user, data->ns, "kickoff_time",
iota(pdb_get_kickoff_time(u)));
@@ -468,11 +468,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 & FLAG_SAM_CANCHANGETIME)
+ if (store & PDB_CANCHANGETIME)
xmlNewProp(pass, "can_change",
iota(pdb_get_pass_can_change_time(u)));
- if (store & FLAG_SAM_MUSTCHANGETIME)
+ if (store & PDB_MUSTCHANGETIME)
xmlNewProp(pass, "must_change",
iota(pdb_get_pass_must_change_time(u)));