summaryrefslogtreecommitdiffstats
path: root/source/lib/ldb/common
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-11-22 02:05:19 +0000
committerSimo Sorce <idra@samba.org>2006-11-22 02:05:19 +0000
commitee7b96d2bf711c559de5208130c7489c6d288c92 (patch)
tree720e1b28b723c15799bcb7dab0dd29d52462f378 /source/lib/ldb/common
parent96e9b55f73db499f480aba94ec866ceff41cf4e0 (diff)
downloadsamba-ee7b96d2bf711c559de5208130c7489c6d288c92.tar.gz
samba-ee7b96d2bf711c559de5208130c7489c6d288c92.tar.xz
samba-ee7b96d2bf711c559de5208130c7489c6d288c92.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
Diffstat (limited to 'source/lib/ldb/common')
-rw-r--r--source/lib/ldb/common/attrib_handlers.c2
-rw-r--r--source/lib/ldb/common/ldb_dn.c4
-rw-r--r--source/lib/ldb/common/ldb_ldif.c2
-rw-r--r--source/lib/ldb/common/ldb_msg.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/source/lib/ldb/common/attrib_handlers.c b/source/lib/ldb/common/attrib_handlers.c
index 372793a103c..c50f7ed7b1a 100644
--- a/source/lib/ldb/common/attrib_handlers.c
+++ b/source/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/source/lib/ldb/common/ldb_dn.c b/source/lib/ldb/common/ldb_dn.c
index 0a10ed6f2e5..8ee78ca06a3 100644
--- a/source/lib/ldb/common/ldb_dn.c
+++ b/source/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/source/lib/ldb/common/ldb_ldif.c b/source/lib/ldb/common/ldb_ldif.c
index 50e9f5e5904..86041a8b78e 100644
--- a/source/lib/ldb/common/ldb_ldif.c
+++ b/source/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/source/lib/ldb/common/ldb_msg.c b/source/lib/ldb/common/ldb_msg.c
index 2768786b83b..e9ba66aff5d 100644
--- a/source/lib/ldb/common/ldb_msg.c
+++ b/source/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;
}