mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
r25165: Use talloc_asprintf_append_buffer with an unmodified
string.
Jeremy.
(This used to be commit fe30a523df
)
This commit is contained in:
parent
47107b2cde
commit
ab9d7bf4f9
@ -48,13 +48,13 @@ ADS_STATUS ads_get_attrnames_by_oids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
|
||||
|
||||
for (i=0; i<num_OIDs; i++) {
|
||||
|
||||
if ((expr = talloc_asprintf_append(expr, "(attributeId=%s)",
|
||||
if ((expr = talloc_asprintf_append_buffer(expr, "(attributeId=%s)",
|
||||
OIDs[i])) == NULL) {
|
||||
return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
}
|
||||
}
|
||||
|
||||
if ((expr = talloc_asprintf_append(expr, ")")) == NULL) {
|
||||
if ((expr = talloc_asprintf_append_buffer(expr, ")")) == NULL) {
|
||||
return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ static NTSTATUS gpo_prepare_local_store(TALLOC_CTX *mem_ctx,
|
||||
|
||||
while (next_token(&unix_path, tok, "/", sizeof(tok))) {
|
||||
|
||||
current_dir = talloc_asprintf_append(current_dir, "/%s", tok);
|
||||
current_dir = talloc_asprintf_append_buffer(current_dir, "/%s", tok);
|
||||
NT_STATUS_HAVE_NO_MEMORY(current_dir);
|
||||
|
||||
if ((mkdir(current_dir, 0644)) < 0 && errno != EEXIST) {
|
||||
|
@ -2437,7 +2437,7 @@ static NTSTATUS ldapsam_enum_group_members(struct pdb_methods *methods,
|
||||
goto done;
|
||||
}
|
||||
|
||||
filter = talloc_asprintf_append(filter, "(uid=%s)", escape_memberuid);
|
||||
filter = talloc_asprintf_append_buffer(filter, "(uid=%s)", escape_memberuid);
|
||||
if (filter == NULL) {
|
||||
SAFE_FREE(escape_memberuid);
|
||||
ret = NT_STATUS_NO_MEMORY;
|
||||
@ -2447,7 +2447,7 @@ static NTSTATUS ldapsam_enum_group_members(struct pdb_methods *methods,
|
||||
SAFE_FREE(escape_memberuid);
|
||||
}
|
||||
|
||||
filter = talloc_asprintf_append(filter, "))");
|
||||
filter = talloc_asprintf_append_buffer(filter, "))");
|
||||
if (filter == NULL) {
|
||||
ret = NT_STATUS_NO_MEMORY;
|
||||
goto done;
|
||||
@ -3726,7 +3726,7 @@ static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods,
|
||||
for (i=0; i<num_rids; i++) {
|
||||
DOM_SID sid;
|
||||
sid_compose(&sid, domain_sid, rids[i]);
|
||||
allsids = talloc_asprintf_append(allsids, "(sambaSid=%s)",
|
||||
allsids = talloc_asprintf_append_buffer(allsids, "(sambaSid=%s)",
|
||||
sid_string_static(&sid));
|
||||
if (allsids == NULL) {
|
||||
goto done;
|
||||
|
@ -315,7 +315,7 @@ again:
|
||||
ATYPE_WORKSTATION_TRUST,
|
||||
ATYPE_INTERDOMAIN_TRUST);
|
||||
}
|
||||
u_filter = talloc_asprintf_append(u_filter, "(%s=%lu)",
|
||||
u_filter = talloc_asprintf_append_buffer(u_filter, "(%s=%lu)",
|
||||
ad_schema->posix_uidnumber_attr,
|
||||
(unsigned long)ids[idx]->xid.id);
|
||||
CHECK_ALLOC_DONE(u_filter);
|
||||
@ -329,7 +329,7 @@ again:
|
||||
ATYPE_SECURITY_GLOBAL_GROUP,
|
||||
ATYPE_SECURITY_LOCAL_GROUP);
|
||||
}
|
||||
g_filter = talloc_asprintf_append(g_filter, "(%s=%lu)",
|
||||
g_filter = talloc_asprintf_append_buffer(g_filter, "(%s=%lu)",
|
||||
ad_schema->posix_gidnumber_attr,
|
||||
(unsigned long)ids[idx]->xid.id);
|
||||
CHECK_ALLOC_DONE(g_filter);
|
||||
@ -344,16 +344,16 @@ again:
|
||||
filter = talloc_asprintf(memctx, "(|");
|
||||
CHECK_ALLOC_DONE(filter);
|
||||
if ( u_filter) {
|
||||
filter = talloc_asprintf_append(filter, "%s))", u_filter);
|
||||
filter = talloc_asprintf_append_buffer(filter, "%s))", u_filter);
|
||||
CHECK_ALLOC_DONE(filter);
|
||||
TALLOC_FREE(u_filter);
|
||||
}
|
||||
if ( g_filter) {
|
||||
filter = talloc_asprintf_append(filter, "%s))", g_filter);
|
||||
filter = talloc_asprintf_append_buffer(filter, "%s))", g_filter);
|
||||
CHECK_ALLOC_DONE(filter);
|
||||
TALLOC_FREE(g_filter);
|
||||
}
|
||||
filter = talloc_asprintf_append(filter, ")");
|
||||
filter = talloc_asprintf_append_buffer(filter, ")");
|
||||
CHECK_ALLOC_DONE(filter);
|
||||
|
||||
rc = ads_search_retry(ads, &res, filter, attrs);
|
||||
@ -535,12 +535,12 @@ again:
|
||||
for (i = 0; (i < IDMAP_AD_MAX_IDS) && ids[idx]; i++, idx++) {
|
||||
|
||||
sidstr = sid_binstring(ids[idx]->sid);
|
||||
filter = talloc_asprintf_append(filter, "(objectSid=%s)", sidstr);
|
||||
filter = talloc_asprintf_append_buffer(filter, "(objectSid=%s)", sidstr);
|
||||
|
||||
free(sidstr);
|
||||
CHECK_ALLOC_DONE(filter);
|
||||
}
|
||||
filter = talloc_asprintf_append(filter, "))");
|
||||
filter = talloc_asprintf_append_buffer(filter, "))");
|
||||
CHECK_ALLOC_DONE(filter);
|
||||
DEBUG(10, ("Filter: [%s]\n", filter));
|
||||
|
||||
|
@ -955,12 +955,12 @@ again:
|
||||
|
||||
bidx = idx;
|
||||
for (i = 0; (i < IDMAP_LDAP_MAX_IDS) && ids[idx]; i++, idx++) {
|
||||
filter = talloc_asprintf_append(filter, "(%s=%lu)",
|
||||
filter = talloc_asprintf_append_buffer(filter, "(%s=%lu)",
|
||||
(ids[idx]->xid.type==ID_TYPE_UID)?uidNumber:gidNumber,
|
||||
(unsigned long)ids[idx]->xid.id);
|
||||
CHECK_ALLOC_DONE(filter);
|
||||
}
|
||||
filter = talloc_asprintf_append(filter, "))");
|
||||
filter = talloc_asprintf_append_buffer(filter, "))");
|
||||
CHECK_ALLOC_DONE(filter);
|
||||
DEBUG(10, ("Filter: [%s]\n", filter));
|
||||
} else {
|
||||
@ -1185,12 +1185,12 @@ again:
|
||||
|
||||
bidx = idx;
|
||||
for (i = 0; (i < IDMAP_LDAP_MAX_IDS) && ids[idx]; i++, idx++) {
|
||||
filter = talloc_asprintf_append(filter, "(%s=%s)",
|
||||
filter = talloc_asprintf_append_buffer(filter, "(%s=%s)",
|
||||
LDAP_ATTRIBUTE_SID,
|
||||
sid_string_static(ids[idx]->sid));
|
||||
CHECK_ALLOC_DONE(filter);
|
||||
}
|
||||
filter = talloc_asprintf_append(filter, "))");
|
||||
filter = talloc_asprintf_append_buffer(filter, "))");
|
||||
CHECK_ALLOC_DONE(filter);
|
||||
DEBUG(10, ("Filter: [%s]", filter));
|
||||
} else {
|
||||
|
@ -858,7 +858,7 @@ static const char *collect_onlinestatus(TALLOC_CTX *mem_ctx)
|
||||
}
|
||||
|
||||
for (domain = domain_list(); domain; domain = domain->next) {
|
||||
if ((buf = talloc_asprintf_append(buf, "%s:%s ",
|
||||
if ((buf = talloc_asprintf_append_buffer(buf, "%s:%s ",
|
||||
domain->name,
|
||||
domain->online ?
|
||||
"Online":"Offline")) == NULL) {
|
||||
@ -866,7 +866,7 @@ static const char *collect_onlinestatus(TALLOC_CTX *mem_ctx)
|
||||
}
|
||||
}
|
||||
|
||||
buf = talloc_asprintf_append(buf, "\n");
|
||||
buf = talloc_asprintf_append_buffer(buf, "\n");
|
||||
|
||||
DEBUG(5,("collect_onlinestatus: %s", buf));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user