diff options
author | Simo Sorce <idra@samba.org> | 2005-06-23 23:19:31 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:18:42 -0500 |
commit | ce2e35309e26d7fc23ba54f1caeb8aeeefa7ccc2 (patch) | |
tree | abc7f8edcac00f0710ebc5b3244ea9aed59cd9e7 /source4/lib/ldb/common | |
parent | 66a52992ff6a9f2f926249ac428d6fad72303637 (diff) | |
download | samba-ce2e35309e26d7fc23ba54f1caeb8aeeefa7ccc2.tar.gz samba-ce2e35309e26d7fc23ba54f1caeb8aeeefa7ccc2.tar.bz2 samba-ce2e35309e26d7fc23ba54f1caeb8aeeefa7ccc2.zip |
r7851: We are case preserving let the DN be returned the same the user put it into.
sss
(This used to be commit 5b41e3202456549250e6e5b1c63bd45ea7500fa3)
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r-- | source4/lib/ldb/common/ldb_explode_dn.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/source4/lib/ldb/common/ldb_explode_dn.c b/source4/lib/ldb/common/ldb_explode_dn.c index 30e5740652..0dcca5dc70 100644 --- a/source4/lib/ldb/common/ldb_explode_dn.c +++ b/source4/lib/ldb/common/ldb_explode_dn.c @@ -154,12 +154,11 @@ ldb_explode_dn(void * mem_ctx, } /* Copy the provided DN so we can manipulate it */ - if ((p = ldb_dn_fold(mem_ctx, orig_dn, - hUserData, case_fold_attr_fn)) == NULL) { + if ((dn_copy = talloc_strdup(mem_ctx, orig_dn)) == NULL) { goto failed; } - dn_copy = p; + p = dn_copy; /* Our copy may end shorter than the original as we unescape chars */ dn_end = dn_copy + orig_len + 1; @@ -224,13 +223,17 @@ ldb_explode_dn(void * mem_ctx, goto failed; } - /* attribute names are always case-folded */ - p = attribute->name; - if ((attribute->name = - ldb_casefold(attribute, p)) == NULL) { - goto failed; - } - talloc_free(p); + /* see if this attribute name needs case folding */ + if (case_fold_attr_fn != NULL && + (* case_fold_attr_fn)(hUserData, + attribute->name)) { + p = attribute->name; + if ((attribute->name = + ldb_casefold(attribute, p)) == NULL) { + goto failed; + } + talloc_free(p); + } ldb_debug(mem_ctx, LDB_DEBUG_TRACE, |