1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3: Convert tldap_make_mod_fmt args to "array, count"

This commit is contained in:
Volker Lendecke 2011-02-12 16:51:08 +01:00
parent 6375e6993e
commit 158c1e315b
3 changed files with 18 additions and 18 deletions

View File

@ -42,7 +42,7 @@ bool tldap_make_mod_blob(struct tldap_message *existing, TALLOC_CTX *mem_ctx,
struct tldap_mod **pmods, int *pnum_mods,
const char *attrib, DATA_BLOB newval);
bool tldap_make_mod_fmt(struct tldap_message *existing, TALLOC_CTX *mem_ctx,
int *pnum_mods, struct tldap_mod **pmods,
struct tldap_mod **pmods, int *pnum_mods,
const char *attrib, const char *fmt, ...);
const char *tldap_errstr(TALLOC_CTX *mem_ctx, struct tldap_context *ld,

View File

@ -302,7 +302,7 @@ static int compare_utf8_blobs(const DATA_BLOB *d1, const DATA_BLOB *d2)
}
bool tldap_make_mod_fmt(struct tldap_message *existing, TALLOC_CTX *mem_ctx,
int *pnum_mods, struct tldap_mod **pmods,
struct tldap_mod **pmods, int *pnum_mods,
const char *attrib, const char *fmt, ...)
{
va_list ap;

View File

@ -301,7 +301,7 @@ static bool pdb_ads_init_ads_from_sam(struct pdb_ads_state *state,
/* TODO: All fields :-) */
ret &= tldap_make_mod_fmt(
existing, mem_ctx, pnum_mods, pmods, "displayName",
existing, mem_ctx, pmods, pnum_mods, "displayName",
"%s", pdb_get_fullname(sam));
pw = pdb_get_plaintext_passwd(sam);
@ -340,23 +340,23 @@ static bool pdb_ads_init_ads_from_sam(struct pdb_ads_state *state,
}
ret &= tldap_make_mod_fmt(
existing, mem_ctx, pnum_mods, pmods, "userAccountControl",
existing, mem_ctx, pmods, pnum_mods, "userAccountControl",
"%d", ds_acb2uf(pdb_get_acct_ctrl(sam)));
ret &= tldap_make_mod_fmt(
existing, mem_ctx, pnum_mods, pmods, "homeDirectory",
existing, mem_ctx, pmods, pnum_mods, "homeDirectory",
"%s", pdb_get_homedir(sam));
ret &= tldap_make_mod_fmt(
existing, mem_ctx, pnum_mods, pmods, "homeDrive",
existing, mem_ctx, pmods, pnum_mods, "homeDrive",
"%s", pdb_get_dir_drive(sam));
ret &= tldap_make_mod_fmt(
existing, mem_ctx, pnum_mods, pmods, "scriptPath",
existing, mem_ctx, pmods, pnum_mods, "scriptPath",
"%s", pdb_get_logon_script(sam));
ret &= tldap_make_mod_fmt(
existing, mem_ctx, pnum_mods, pmods, "profilePath",
existing, mem_ctx, pmods, pnum_mods, "profilePath",
"%s", pdb_get_profile_path(sam));
fail:
@ -507,9 +507,9 @@ static NTSTATUS pdb_ads_create_user(struct pdb_methods *m,
ok = true;
ok &= tldap_make_mod_fmt(
NULL, talloc_tos(), &num_mods, &mods, "objectClass", "user");
NULL, talloc_tos(), &mods, &num_mods, "objectClass", "user");
ok &= tldap_make_mod_fmt(
NULL, talloc_tos(), &num_mods, &mods, "samAccountName", "%s",
NULL, talloc_tos(), &mods, &num_mods, "samAccountName", "%s",
name);
if (!ok) {
return NT_STATUS_NO_MEMORY;
@ -791,12 +791,12 @@ static NTSTATUS pdb_ads_create_dom_group(struct pdb_methods *m,
}
ok &= tldap_make_mod_fmt(
NULL, talloc_tos(), &num_mods, &mods, "samAccountName", "%s",
NULL, talloc_tos(), &mods, &num_mods, "samAccountName", "%s",
name);
ok &= tldap_make_mod_fmt(
NULL, talloc_tos(), &num_mods, &mods, "objectClass", "group");
NULL, talloc_tos(), &mods, &num_mods, "objectClass", "group");
ok &= tldap_make_mod_fmt(
NULL, talloc_tos(), &num_mods, &mods, "groupType",
NULL, talloc_tos(), &mods, &num_mods, "groupType",
"%d", (int)GTYPE_SECURITY_GLOBAL_GROUP);
if (!ok) {
@ -1176,12 +1176,12 @@ static NTSTATUS pdb_ads_create_alias(struct pdb_methods *m,
}
ok &= tldap_make_mod_fmt(
NULL, talloc_tos(), &num_mods, &mods, "samAccountName", "%s",
NULL, talloc_tos(), &mods, &num_mods, "samAccountName", "%s",
name);
ok &= tldap_make_mod_fmt(
NULL, talloc_tos(), &num_mods, &mods, "objectClass", "group");
NULL, talloc_tos(), &mods, &num_mods, "objectClass", "group");
ok &= tldap_make_mod_fmt(
NULL, talloc_tos(), &num_mods, &mods, "groupType",
NULL, talloc_tos(), &mods, &num_mods, "groupType",
"%d", (int)GTYPE_SECURITY_DOMAIN_LOCAL_GROUP);
if (!ok) {
@ -1335,10 +1335,10 @@ static NTSTATUS pdb_ads_set_aliasinfo(struct pdb_methods *m,
ok = true;
ok &= tldap_make_mod_fmt(
msg[0], msg, &num_mods, &mods, "description",
msg[0], msg, &mods, &num_mods, "description",
"%s", info->acct_desc);
ok &= tldap_make_mod_fmt(
msg[0], msg, &num_mods, &mods, "samAccountName",
msg[0], msg, &mods, &num_mods, "samAccountName",
"%s", info->acct_name);
if (!ok) {
TALLOC_FREE(msg);