From a9e31b33b55a873c2f01db5e348560176adf863d Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 22 Nov 2006 02:05:19 +0000 Subject: r19832: better prototypes for the linearization functions: - ldb_dn_get_linearized returns a const string - ldb_dn_alloc_linearized allocs astring with the linearized dn (This used to be commit 3929c086d5d0b3f08b1c4f2f3f9602c3f4a9a4bd) --- source4/lib/ldb/common/attrib_handlers.c | 2 +- source4/lib/ldb/common/ldb_dn.c | 4 ++-- source4/lib/ldb/common/ldb_ldif.c | 2 +- source4/lib/ldb/common/ldb_msg.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source4/lib/ldb/common') diff --git a/source4/lib/ldb/common/attrib_handlers.c b/source4/lib/ldb/common/attrib_handlers.c index 372793a103..c50f7ed7b1 100644 --- a/source4/lib/ldb/common/attrib_handlers.c +++ b/source4/lib/ldb/common/attrib_handlers.c @@ -239,7 +239,7 @@ static int ldb_canonicalise_dn(struct ldb_context *ldb, void *mem_ctx, return -1; } - out->data = (uint8_t *)ldb_dn_linearize(mem_ctx, dn); + out->data = (uint8_t *)ldb_dn_alloc_linearized(mem_ctx, dn); if (out->data == NULL) { goto done; } diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c index 0a10ed6f2e..8ee78ca06a 100644 --- a/source4/lib/ldb/common/ldb_dn.c +++ b/source4/lib/ldb/common/ldb_dn.c @@ -561,7 +561,7 @@ const char *ldb_dn_get_linearized(struct ldb_dn *dn) return dn->linearized; } -char *ldb_dn_linearize(void *mem_ctx, struct ldb_dn *dn) +char *ldb_dn_alloc_linearized(void *mem_ctx, struct ldb_dn *dn) { return talloc_strdup(mem_ctx, ldb_dn_get_linearized(dn)); } @@ -664,7 +664,7 @@ const char *ldb_dn_get_casefold(struct ldb_dn *dn) return dn->casefold; } -char *ldb_dn_casefold(void *mem_ctx, struct ldb_dn *dn) +char *ldb_dn_alloc_casefold(void *mem_ctx, struct ldb_dn *dn) { return talloc_strdup(mem_ctx, ldb_dn_get_casefold(dn)); } diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c index 50e9f5e590..86041a8b78 100644 --- a/source4/lib/ldb/common/ldb_ldif.c +++ b/source4/lib/ldb/common/ldb_ldif.c @@ -286,7 +286,7 @@ int ldb_ldif_write(struct ldb_context *ldb, msg = ldif->msg; - ret = fprintf_fn(private_data, "dn: %s\n", ldb_dn_linearize(msg->dn, msg->dn)); + ret = fprintf_fn(private_data, "dn: %s\n", ldb_dn_get_linearized(msg->dn)); CHECK_RET; if (ldif->changetype != LDB_CHANGETYPE_NONE) { diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c index 2768786b83..e9ba66aff5 100644 --- a/source4/lib/ldb/common/ldb_msg.c +++ b/source4/lib/ldb/common/ldb_msg.c @@ -626,7 +626,7 @@ int ldb_msg_sanity_check(struct ldb_context *ldb, /* TODO: return also an error string */ ldb_asprintf_errstring(ldb, "Element %s has empty attribute in ldb message (%s)!", msg->elements[i].name, - ldb_dn_linearize(mem_ctx, msg->dn)); + ldb_dn_get_linearized(msg->dn)); talloc_free(mem_ctx); return LDB_ERR_INVALID_ATTRIBUTE_SYNTAX; } -- cgit