From 759da3b915e2006d4c87b5ace47f399accd9ce91 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 27 Jan 2005 07:08:20 +0000 Subject: r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for the large commit. I thought this was worthwhile to get done for consistency. (This used to be commit ec32b22ed5ec224f6324f5e069d15e92e38e15c0) --- source4/ldap_server/ldap_backend.c | 2 +- source4/ldap_server/ldap_hacked_ldb.c | 30 +++++++++++++++--------------- source4/ldap_server/ldap_parse.c | 24 ++++++++++++------------ source4/ldap_server/ldap_rootdse.c | 14 +++++++------- source4/ldap_server/ldap_server.c | 16 ++++++++-------- source4/ldap_server/ldap_simple_ldb.c | 18 +++++++++--------- 6 files changed, 52 insertions(+), 52 deletions(-) (limited to 'source4/ldap_server') diff --git a/source4/ldap_server/ldap_backend.c b/source4/ldap_server/ldap_backend.c index 8a26c3fd8f..58c6dde436 100644 --- a/source4/ldap_server/ldap_backend.c +++ b/source4/ldap_server/ldap_backend.c @@ -27,7 +27,7 @@ struct ldapsrv_reply *ldapsrv_init_reply(struct ldapsrv_call *call, enum ldap_re { struct ldapsrv_reply *reply; - reply = talloc_p(call, struct ldapsrv_reply); + reply = talloc(call, struct ldapsrv_reply); if (!reply) { return NULL; } diff --git a/source4/ldap_server/ldap_hacked_ldb.c b/source4/ldap_server/ldap_hacked_ldb.c index 09c8f28277..4beb364c0e 100644 --- a/source4/ldap_server/ldap_hacked_ldb.c +++ b/source4/ldap_server/ldap_hacked_ldb.c @@ -322,7 +322,7 @@ static NTSTATUS hacked_Search(struct ldapsrv_partition *partition, struct ldapsr } if (r->num_attributes >= 1) { - attrs = talloc_array_p(samdb, const char *, r->num_attributes+1); + attrs = talloc_array(samdb, const char *, r->num_attributes+1); NT_STATUS_HAVE_NO_MEMORY(attrs); for (j=0; j < r->num_attributes; j++) { @@ -354,7 +354,7 @@ DEBUGADD(0,("hacked filter: %s\n", r->filter)); goto queue_reply; } ent->num_attributes = res[0]->num_elements; - ent->attributes = talloc_array_p(ent_r, struct ldap_attribute, ent->num_attributes); + ent->attributes = talloc_array(ent_r, struct ldap_attribute, ent->num_attributes); NT_STATUS_HAVE_NO_MEMORY(ent->attributes); for (j=0; j < ent->num_attributes; j++) { ent->attributes[j].name = talloc_steal(ent->attributes, res[0]->elements[j].name); @@ -362,7 +362,7 @@ DEBUGADD(0,("hacked filter: %s\n", r->filter)); ent->attributes[j].values = NULL; ent->attributes[j].num_values = res[0]->elements[j].num_values; if (ent->attributes[j].num_values == 1) { - ent->attributes[j].values = talloc_array_p(ent->attributes, + ent->attributes[j].values = talloc_array(ent->attributes, DATA_BLOB, ent->attributes[j].num_values); NT_STATUS_HAVE_NO_MEMORY(ent->attributes[j].values); status = convert_values(ent_r, @@ -373,7 +373,7 @@ DEBUGADD(0,("hacked filter: %s\n", r->filter)); return status; } } else { - ent->attributes[j].values = talloc_array_p(ent->attributes, + ent->attributes[j].values = talloc_array(ent->attributes, DATA_BLOB, ent->attributes[j].num_values); NT_STATUS_HAVE_NO_MEMORY(ent->attributes[j].values); for (y=0; y < ent->attributes[j].num_values; y++) { @@ -402,7 +402,7 @@ queue_reply: goto queue_reply2; } ent->num_attributes = res[i]->num_elements; - ent->attributes = talloc_array_p(ent_r, struct ldap_attribute, ent->num_attributes); + ent->attributes = talloc_array(ent_r, struct ldap_attribute, ent->num_attributes); NT_STATUS_HAVE_NO_MEMORY(ent->attributes); for (j=0; j < ent->num_attributes; j++) { ent->attributes[j].name = talloc_steal(ent->attributes, res[i]->elements[j].name); @@ -412,7 +412,7 @@ queue_reply: continue; } ent->attributes[j].num_values = res[i]->elements[j].num_values; - ent->attributes[j].values = talloc_array_p(ent->attributes, + ent->attributes[j].values = talloc_array(ent->attributes, DATA_BLOB, ent->attributes[j].num_values); NT_STATUS_HAVE_NO_MEMORY(ent->attributes[j].values); if (ent->attributes[j].num_values == 1) { @@ -520,7 +520,7 @@ static NTSTATUS hldb_Search(struct ldapsrv_partition *partition, struct ldapsrv_ } if (r->num_attributes >= 1) { - attrs = talloc_array_p(samdb, const char *, r->num_attributes+1); + attrs = talloc_array(samdb, const char *, r->num_attributes+1); NT_STATUS_HAVE_NO_MEMORY(attrs); for (i=0; i < r->num_attributes; i++) { @@ -552,7 +552,7 @@ static NTSTATUS hldb_Search(struct ldapsrv_partition *partition, struct ldapsrv_ goto queue_reply; } ent->num_attributes = res[i]->num_elements; - ent->attributes = talloc_array_p(ent_r, struct ldap_attribute, ent->num_attributes); + ent->attributes = talloc_array(ent_r, struct ldap_attribute, ent->num_attributes); NT_STATUS_HAVE_NO_MEMORY(ent->attributes); for (j=0; j < ent->num_attributes; j++) { ent->attributes[j].name = talloc_steal(ent->attributes, res[i]->elements[j].name); @@ -562,7 +562,7 @@ static NTSTATUS hldb_Search(struct ldapsrv_partition *partition, struct ldapsrv_ continue; } ent->attributes[j].num_values = res[i]->elements[j].num_values; - ent->attributes[j].values = talloc_array_p(ent->attributes, + ent->attributes[j].values = talloc_array(ent->attributes, DATA_BLOB, ent->attributes[j].num_values); NT_STATUS_HAVE_NO_MEMORY(ent->attributes[j].values); for (y=0; y < ent->attributes[j].num_values; y++) { @@ -635,7 +635,7 @@ static NTSTATUS hldb_Add(struct ldapsrv_partition *partition, struct ldapsrv_cal DEBUG(10, ("hldb_add: dn: [%s]\n", dn->dn)); - msg = talloc_p(local_ctx, struct ldb_message); + msg = talloc(local_ctx, struct ldb_message); NT_STATUS_HAVE_NO_MEMORY(msg); msg->dn = dn->dn; @@ -645,7 +645,7 @@ static NTSTATUS hldb_Add(struct ldapsrv_partition *partition, struct ldapsrv_cal if (r->num_attributes > 0) { msg->num_elements = r->num_attributes; - msg->elements = talloc_array_p(msg, struct ldb_message_element, msg->num_elements); + msg->elements = talloc_array(msg, struct ldb_message_element, msg->num_elements); NT_STATUS_HAVE_NO_MEMORY(msg->elements); for (i=0; i < msg->num_elements; i++) { @@ -656,7 +656,7 @@ static NTSTATUS hldb_Add(struct ldapsrv_partition *partition, struct ldapsrv_cal if (r->attributes[i].num_values > 0) { msg->elements[i].num_values = r->attributes[i].num_values; - msg->elements[i].values = talloc_array_p(msg, struct ldb_val, msg->elements[i].num_values); + msg->elements[i].values = talloc_array(msg, struct ldb_val, msg->elements[i].num_values); NT_STATUS_HAVE_NO_MEMORY(msg->elements[i].values); for (j=0; j < msg->elements[i].num_values; j++) { @@ -787,7 +787,7 @@ static NTSTATUS hldb_Modify(struct ldapsrv_partition *partition, struct ldapsrv_ DEBUG(10, ("hldb_modify: dn: [%s]\n", dn->dn)); - msg = talloc_p(local_ctx, struct ldb_message); + msg = talloc(local_ctx, struct ldb_message); NT_STATUS_HAVE_NO_MEMORY(msg); msg->dn = dn->dn; @@ -797,7 +797,7 @@ static NTSTATUS hldb_Modify(struct ldapsrv_partition *partition, struct ldapsrv_ if (r->num_mods > 0) { msg->num_elements = r->num_mods; - msg->elements = talloc_array_p(msg, struct ldb_message_element, r->num_mods); + msg->elements = talloc_array(msg, struct ldb_message_element, r->num_mods); NT_STATUS_HAVE_NO_MEMORY(msg->elements); for (i=0; i < msg->num_elements; i++) { @@ -823,7 +823,7 @@ static NTSTATUS hldb_Modify(struct ldapsrv_partition *partition, struct ldapsrv_ msg->elements[i].num_values = r->mods[i].attrib.num_values; if (msg->elements[i].num_values > 0) { - msg->elements[i].values = talloc_array_p(msg, struct ldb_val, msg->elements[i].num_values); + msg->elements[i].values = talloc_array(msg, struct ldb_val, msg->elements[i].num_values); NT_STATUS_HAVE_NO_MEMORY(msg->elements[i].values); for (j=0; j < msg->elements[i].num_values; j++) { diff --git a/source4/ldap_server/ldap_parse.c b/source4/ldap_server/ldap_parse.c index 5db65ee99c..d411b26c1a 100644 --- a/source4/ldap_server/ldap_parse.c +++ b/source4/ldap_server/ldap_parse.c @@ -80,7 +80,7 @@ static void ldap_parse_attributetypedescription(struct ldap_schema *schema, DATA { char *desc; - desc = talloc_array_p(schema, char, data->lenght + 1); + desc = talloc_array(schema, char, data->lenght + 1); memcpy(desc, data->data, data->lenght); desc[data->lenght] = '\0'; @@ -90,7 +90,7 @@ static void ldap_parse_objectclassdescription(struct ldap_schema *schema, DATA_B { char *desc; - desc = talloc_array_p(schema, char, data->lenght + 1); + desc = talloc_array(schema, char, data->lenght + 1); memcpy(desc, data->data, data->lenght); desc[data->lenght] = '\0'; @@ -112,7 +112,7 @@ static struct ldap_schema *ldap_get_schema(void *mem_ctx, struct ldap_schema *sc local_schema = schema; if (local_schema == NULL) { - local_schema = talloc_p(mem_ctx, struct ldap_schema); + local_schema = talloc(mem_ctx, struct ldap_schema); ALLOC_CHECK(local_schema); } @@ -156,10 +156,10 @@ struct ldap_dn *ldap_parse_dn(void *mem_ctx, const char *orig_dn) char *p, *start, *separator, *src, *dest, *dn_copy, *dn_end; int i, size, orig_len; - dn = talloc_p(mem_ctx, struct ldap_dn); + dn = talloc(mem_ctx, struct ldap_dn); dn->comp_num = 0; - dn->components = talloc_array_p(dn, struct dn_component *, 1); - component = talloc_p(dn, struct dn_component); + dn->components = talloc_array(dn, struct dn_component *, 1); + component = talloc(dn, struct dn_component); component->attr_num = 0; orig_len = strlen(orig_dn); @@ -171,8 +171,8 @@ struct ldap_dn *ldap_parse_dn(void *mem_ctx, const char *orig_dn) dn_copy = p = talloc_strdup(mem_ctx, orig_dn); dn_end = dn_copy + orig_len + 1; do { - component->attributes = talloc_array_p(component, struct dn_attribute *, 1); - attribute = talloc_p(component, struct dn_attribute); + component->attributes = talloc_array(component, struct dn_attribute *, 1); + attribute = talloc(component, struct dn_attribute); /* skip "spaces" */ while (*p == ' ' || *p == '\n') { @@ -255,10 +255,10 @@ struct ldap_dn *ldap_parse_dn(void *mem_ctx, const char *orig_dn) component->attr_num++; if (*separator == '+') { /* expect other attributes in this component */ - component->attributes = talloc_realloc_p(component, component->attributes, struct dn_attribute *, component->attr_num + 1); + component->attributes = talloc_realloc(component, component->attributes, struct dn_attribute *, component->attr_num + 1); /* allocate new attribute structure */ - attribute = talloc_p(component, struct dn_attribute); + attribute = talloc(component, struct dn_attribute); /* skip spaces past the separator */ p = separator + strspn(p, " \n"); @@ -290,8 +290,8 @@ struct ldap_dn *ldap_parse_dn(void *mem_ctx, const char *orig_dn) dn->comp_num++; if (*separator == ',' || *separator == ';') { - dn->components = talloc_realloc_p(dn, dn->components, struct dn_component *, dn->comp_num + 1); - component = talloc_p(dn, struct dn_component); + dn->components = talloc_realloc(dn, dn->components, struct dn_component *, dn->comp_num + 1); + component = talloc(dn, struct dn_component); component->attr_num = 0; } p = separator + 1; diff --git a/source4/ldap_server/ldap_rootdse.c b/source4/ldap_server/ldap_rootdse.c index e1f3618072..3ab1ef03af 100644 --- a/source4/ldap_server/ldap_rootdse.c +++ b/source4/ldap_server/ldap_rootdse.c @@ -84,7 +84,7 @@ static void *rootdse_db_connect(TALLOC_CTX *mem_ctx) return talloc_reference(mem_ctx, ctx); } - ctx = talloc_p(mem_ctx, struct rootdse_db_context); + ctx = talloc(mem_ctx, struct rootdse_db_context); if (ctx == NULL) { errno = ENOMEM; return NULL; @@ -124,7 +124,7 @@ static NTSTATUS fill_dynamic_values(void *mem_ctx, struct ldap_attribute *attrs) if (strcasecmp(attrs->name, "currentTime") == 0) { int num_currentTime = 1; - DATA_BLOB *currentTime = talloc_array_p(mem_ctx, DATA_BLOB, num_currentTime); + DATA_BLOB *currentTime = talloc_array(mem_ctx, DATA_BLOB, num_currentTime); char *str = ldap_timestring(mem_ctx, time(NULL)); NT_STATUS_HAVE_NO_MEMORY(str); currentTime[0].data = (uint8_t *)str; @@ -205,7 +205,7 @@ static NTSTATUS fill_dynamic_values(void *mem_ctx, struct ldap_attribute *attrs) if (strcasecmp(attrs->name, "supportedLDAPVersion") == 0) { int num_supportedLDAPVersion = 1; - DATA_BLOB *supportedLDAPVersion = talloc_array_p(mem_ctx, DATA_BLOB, num_supportedLDAPVersion); + DATA_BLOB *supportedLDAPVersion = talloc_array(mem_ctx, DATA_BLOB, num_supportedLDAPVersion); supportedLDAPVersion[0] = ATTR_BLOB_CONST("3"); ATTR_SINGLE_NOVAL(mem_ctx, attrs, supportedLDAPVersion, num_supportedLDAPVersion, "supportedLDAPVersion"); return NT_STATUS_OK; @@ -288,7 +288,7 @@ static NTSTATUS fill_dynamic_values(void *mem_ctx, struct ldap_attribute *attrs) */ { - DATA_BLOB *x = talloc_array_p(mem_ctx, DATA_BLOB, 1); + DATA_BLOB *x = talloc_array(mem_ctx, DATA_BLOB, 1); x[0] = ATTR_BLOB_CONST("0"); ATTR_SINGLE_NOVAL(mem_ctx, attrs, x, 1, attrs->name); } @@ -321,7 +321,7 @@ static NTSTATUS rootdse_Search(struct ldapsrv_partition *partition, struct ldaps NT_STATUS_HAVE_NO_MEMORY(rootdsedb); if (r->num_attributes >= 1) { - attrs = talloc_array_p(rootdsedb, const char *, r->num_attributes+1); + attrs = talloc_array(rootdsedb, const char *, r->num_attributes+1); NT_STATUS_HAVE_NO_MEMORY(attrs); for (j=0; j < r->num_attributes; j++) { @@ -346,7 +346,7 @@ static NTSTATUS rootdse_Search(struct ldapsrv_partition *partition, struct ldaps goto queue_reply; } ent->num_attributes = res[0]->num_elements; - ent->attributes = talloc_array_p(ent_r, struct ldap_attribute, ent->num_attributes); + ent->attributes = talloc_array(ent_r, struct ldap_attribute, ent->num_attributes); NT_STATUS_HAVE_NO_MEMORY(ent->attributes); for (j=0; j < ent->num_attributes; j++) { ent->attributes[j].name = talloc_steal(ent->attributes, res[0]->elements[j].name); @@ -360,7 +360,7 @@ static NTSTATUS rootdse_Search(struct ldapsrv_partition *partition, struct ldaps return status; } } else { - ent->attributes[j].values = talloc_array_p(ent->attributes, + ent->attributes[j].values = talloc_array(ent->attributes, DATA_BLOB, ent->attributes[j].num_values); NT_STATUS_HAVE_NO_MEMORY(ent->attributes[j].values); for (y=0; y < ent->attributes[j].num_values; y++) { diff --git a/source4/ldap_server/ldap_server.c b/source4/ldap_server/ldap_server.c index 3c27577b66..d5b4aaae43 100644 --- a/source4/ldap_server/ldap_server.c +++ b/source4/ldap_server/ldap_server.c @@ -65,16 +65,16 @@ static void ldapsrv_init(struct server_service *service) DEBUG(10,("ldapsrv_init\n")); - ldap_service = talloc_p(service, struct ldapsrv_service); + ldap_service = talloc(service, struct ldapsrv_service); if (!ldap_service) { - DEBUG(0,("talloc_p(service, struct ldapsrv_service) failed\n")); + DEBUG(0,("talloc(service, struct ldapsrv_service) failed\n")); return; } ZERO_STRUCTP(ldap_service); - rootDSE_part = talloc_p(ldap_service, struct ldapsrv_partition); + rootDSE_part = talloc(ldap_service, struct ldapsrv_partition); if (!rootDSE_part) { - DEBUG(0,("talloc_p(ldap_service, struct ldapsrv_partition) failed\n")); + DEBUG(0,("talloc(ldap_service, struct ldapsrv_partition) failed\n")); return; } rootDSE_part->base_dn = ""; /* RootDSE */ @@ -83,9 +83,9 @@ static void ldapsrv_init(struct server_service *service) ldap_service->rootDSE = rootDSE_part; DLIST_ADD_END(ldap_service->partitions, rootDSE_part, struct ldapsrv_partition *); - part = talloc_p(ldap_service, struct ldapsrv_partition); + part = talloc(ldap_service, struct ldapsrv_partition); if (!ldap_service) { - DEBUG(0,("talloc_p(ldap_service, struct ldapsrv_partition) failed\n")); + DEBUG(0,("talloc(ldap_service, struct ldapsrv_partition) failed\n")); return; } part->base_dn = "*"; /* default partition */ @@ -467,7 +467,7 @@ static void ldapsrv_recv(struct server_connection *conn, struct timeval t, return; } - call = talloc_p(ldap_conn, struct ldapsrv_call); + call = talloc(ldap_conn, struct ldapsrv_call); if (!call) { ldapsrv_terminate_connection(ldap_conn, "no memory"); return; @@ -546,7 +546,7 @@ static void ldapsrv_accept(struct server_connection *conn) DEBUG(10, ("ldapsrv_accept\n")); - ldap_conn = talloc_p(conn, struct ldapsrv_connection); + ldap_conn = talloc(conn, struct ldapsrv_connection); if (ldap_conn == NULL) return; diff --git a/source4/ldap_server/ldap_simple_ldb.c b/source4/ldap_server/ldap_simple_ldb.c index e16d187162..41431e091b 100644 --- a/source4/ldap_server/ldap_simple_ldb.c +++ b/source4/ldap_server/ldap_simple_ldb.c @@ -79,7 +79,7 @@ static NTSTATUS sldb_Search(struct ldapsrv_partition *partition, struct ldapsrv_ } if (r->num_attributes >= 1) { - attrs = talloc_array_p(samdb, const char *, r->num_attributes+1); + attrs = talloc_array(samdb, const char *, r->num_attributes+1); NT_STATUS_HAVE_NO_MEMORY(attrs); for (i=0; i < r->num_attributes; i++) { @@ -104,7 +104,7 @@ static NTSTATUS sldb_Search(struct ldapsrv_partition *partition, struct ldapsrv_ goto queue_reply; } ent->num_attributes = res[i]->num_elements; - ent->attributes = talloc_array_p(ent_r, struct ldap_attribute, ent->num_attributes); + ent->attributes = talloc_array(ent_r, struct ldap_attribute, ent->num_attributes); NT_STATUS_HAVE_NO_MEMORY(ent->attributes); for (j=0; j < ent->num_attributes; j++) { ent->attributes[j].name = talloc_steal(ent->attributes, res[i]->elements[j].name); @@ -114,7 +114,7 @@ static NTSTATUS sldb_Search(struct ldapsrv_partition *partition, struct ldapsrv_ continue; } ent->attributes[j].num_values = res[i]->elements[j].num_values; - ent->attributes[j].values = talloc_array_p(ent->attributes, + ent->attributes[j].values = talloc_array(ent->attributes, DATA_BLOB, ent->attributes[j].num_values); NT_STATUS_HAVE_NO_MEMORY(ent->attributes[j].values); for (y=0; y < ent->attributes[j].num_values; y++) { @@ -186,7 +186,7 @@ static NTSTATUS sldb_Add(struct ldapsrv_partition *partition, struct ldapsrv_cal DEBUG(10, ("sldb_add: dn: [%s]\n", dn->dn)); - msg = talloc_p(local_ctx, struct ldb_message); + msg = talloc(local_ctx, struct ldb_message); NT_STATUS_HAVE_NO_MEMORY(msg); msg->dn = dn->dn; @@ -196,7 +196,7 @@ static NTSTATUS sldb_Add(struct ldapsrv_partition *partition, struct ldapsrv_cal if (r->num_attributes > 0) { msg->num_elements = r->num_attributes; - msg->elements = talloc_array_p(msg, struct ldb_message_element, msg->num_elements); + msg->elements = talloc_array(msg, struct ldb_message_element, msg->num_elements); NT_STATUS_HAVE_NO_MEMORY(msg->elements); for (i=0; i < msg->num_elements; i++) { @@ -207,7 +207,7 @@ static NTSTATUS sldb_Add(struct ldapsrv_partition *partition, struct ldapsrv_cal if (r->attributes[i].num_values > 0) { msg->elements[i].num_values = r->attributes[i].num_values; - msg->elements[i].values = talloc_array_p(msg, struct ldb_val, msg->elements[i].num_values); + msg->elements[i].values = talloc_array(msg, struct ldb_val, msg->elements[i].num_values); NT_STATUS_HAVE_NO_MEMORY(msg->elements[i].values); for (j=0; j < msg->elements[i].num_values; j++) { @@ -337,7 +337,7 @@ static NTSTATUS sldb_Modify(struct ldapsrv_partition *partition, struct ldapsrv_ DEBUG(10, ("sldb_modify: dn: [%s]\n", dn->dn)); - msg = talloc_p(local_ctx, struct ldb_message); + msg = talloc(local_ctx, struct ldb_message); NT_STATUS_HAVE_NO_MEMORY(msg); msg->dn = dn->dn; @@ -347,7 +347,7 @@ static NTSTATUS sldb_Modify(struct ldapsrv_partition *partition, struct ldapsrv_ if (r->num_mods > 0) { msg->num_elements = r->num_mods; - msg->elements = talloc_array_p(msg, struct ldb_message_element, r->num_mods); + msg->elements = talloc_array(msg, struct ldb_message_element, r->num_mods); NT_STATUS_HAVE_NO_MEMORY(msg->elements); for (i=0; i < msg->num_elements; i++) { @@ -373,7 +373,7 @@ static NTSTATUS sldb_Modify(struct ldapsrv_partition *partition, struct ldapsrv_ msg->elements[i].num_values = r->mods[i].attrib.num_values; if (msg->elements[i].num_values > 0) { - msg->elements[i].values = talloc_array_p(msg, struct ldb_val, msg->elements[i].num_values); + msg->elements[i].values = talloc_array(msg, struct ldb_val, msg->elements[i].num_values); NT_STATUS_HAVE_NO_MEMORY(msg->elements[i].values); for (j=0; j < msg->elements[i].num_values; j++) { -- cgit