diff options
author | Andrew Bartlett <abartlet@samba.org> | 2005-10-14 02:05:51 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:39:49 -0500 |
commit | 1f9703de40c09b86e25d07fad0e06e303764da8e (patch) | |
tree | 940db5a81269953b3d9812605d9145615c27e6aa /source4/lib/ldb | |
parent | 9dff4c464af4cbe0a031690cf3ad3134669faeb5 (diff) | |
download | samba-1f9703de40c09b86e25d07fad0e06e303764da8e.tar.gz samba-1f9703de40c09b86e25d07fad0e06e303764da8e.tar.bz2 samba-1f9703de40c09b86e25d07fad0e06e303764da8e.zip |
r10980: Use ldb_attr_cmp and ldb_dn_escape_value
Andrew Bartlett
(This used to be commit 2b1c88f628b27ffda08de3f4ac83c1f3b052a078)
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r-- | source4/lib/ldb/common/ldb_dn.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c index 4c1e9a9d07..4ae00ee6dc 100644 --- a/source4/lib/ldb/common/ldb_dn.c +++ b/source4/lib/ldb/common/ldb_dn.c @@ -853,15 +853,15 @@ static char *ldb_dn_canonical(void *mem_ctx, const struct ldb_dn *dn, int ex_for /* Walk backwards down the DN, grabbing 'dc' components at first */ for (i = dn->comp_num - 1 ; i >= 0; i--) { - if (strcasecmp(dn->components[i].name, "dc") != 0) { + if (ldb_attr_cmp(dn->components[i].name, "dc") != 0) { break; } if (cracked) { cracked = talloc_asprintf(mem_ctx, "%s.%s", - (const char *)dn->components[i].value.data, + ldb_dn_escape_value(mem_ctx, dn->components[i].value), cracked); } else { - cracked = talloc_strdup(mem_ctx, (const char *)dn->components[i].value.data); + cracked = ldb_dn_escape_value(mem_ctx, dn->components[i].value); } if (!cracked) { return NULL; @@ -881,7 +881,7 @@ static char *ldb_dn_canonical(void *mem_ctx, const struct ldb_dn *dn, int ex_for /* Now walk backwards appending remaining components */ for (; i > 0; i--) { cracked = talloc_asprintf(mem_ctx, "%s/%s", cracked, - dn->components[i].value.data); + ldb_dn_escape_value(mem_ctx, dn->components[i].value)); if (!cracked) { return NULL; } @@ -890,10 +890,10 @@ static char *ldb_dn_canonical(void *mem_ctx, const struct ldb_dn *dn, int ex_for /* Last one, possibly a newline for the 'ex' format */ if (ex_format) { cracked = talloc_asprintf(mem_ctx, "%s\n%s", cracked, - dn->components[i].value.data); + ldb_dn_escape_value(mem_ctx, dn->components[i].value)); } else { cracked = talloc_asprintf(mem_ctx, "%s/%s", cracked, - dn->components[i].value.data); + ldb_dn_escape_value(mem_ctx, dn->components[i].value)); } return cracked; } |