diff options
author | Simo Sorce <idra@samba.org> | 2006-11-22 02:05:19 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:28:22 -0500 |
commit | a9e31b33b55a873c2f01db5e348560176adf863d (patch) | |
tree | 603f4cb99999eea881f6092fb6cbbbcb8daca184 /source4/lib/ldb/common | |
parent | 4889eb9f7aae9349e426d0f6d2217adff67eaebd (diff) | |
download | samba-a9e31b33b55a873c2f01db5e348560176adf863d.tar.gz samba-a9e31b33b55a873c2f01db5e348560176adf863d.tar.bz2 samba-a9e31b33b55a873c2f01db5e348560176adf863d.zip |
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)
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r-- | source4/lib/ldb/common/attrib_handlers.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb_dn.c | 4 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb_ldif.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb_msg.c | 2 |
4 files changed, 5 insertions, 5 deletions
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; } |