r25165: Use talloc_asprintf_append_buffer with an unmodified
authorJeremy Allison <jra@samba.org>
Fri, 14 Sep 2007 17:42:10 +0000 (17:42 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:30:47 +0000 (12:30 -0500)
string.
Jeremy.
(This used to be commit fe30a523dfc77cc373145624246fd3ad5c62b9ac)

source3/libads/ldap_schema.c
source3/libgpo/gpo_fetch.c
source3/passdb/pdb_ldap.c
source3/winbindd/idmap_ad.c
source3/winbindd/idmap_ldap.c
source3/winbindd/winbindd_dual.c

index 170ee65df71835120ec9f100ce3e2731948b7bfb..ff41ccc8614a7319d237219baf95aa3244e42df8 100644 (file)
@@ -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);
        }
 
index 31c6132b9874502bc415501f9ed57d0397a31734..6be986d5d909a9ddc10d8bfe1a7718fe00ffe2de 100644 (file)
@@ -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) {
index e68c8242ca4e0491cd0de5ab29698645e28b9254..cc123bff22fa86cde087a011e69603f6eae0c433 100644 (file)
@@ -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;
index 41dbb471f9a1e8a302eb11942c5aff3da7a2092b..b2d41e436c3504590d0c305c2c2884dc23044f03 100644 (file)
@@ -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));
 
index 3b63915b052f5c0fd66baffc3bfeb645f6f90f77..9daf084ce180a299f35ac1e130aba204a5f1e888 100644 (file)
@@ -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 {
index 67cf6abc2b7bbc5fcacb6d04dc3cded85aaa912d..d9a42c31dc12f9e76e32838d6b6cc0f47a374f97 100644 (file)
@@ -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));