summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-11-25 15:42:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:28:32 -0500
commit5b258c3b9dda634af721802916880bccffab45a2 (patch)
treec02a9d9c55c120ffb0045a216f6566c785436220 /source4/lib
parentac6fec2f866c9ec1ce4585d1216bef47db560aa4 (diff)
downloadsamba-5b258c3b9dda634af721802916880bccffab45a2.tar.gz
samba-5b258c3b9dda634af721802916880bccffab45a2.tar.bz2
samba-5b258c3b9dda634af721802916880bccffab45a2.zip
r19887: return "" string only if the dn is a valid one
(This used to be commit 056f90798f6d2cea1debc50f31fea3d740c4a837)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/common/ldb_dn.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c
index 3f66943ad2..38d9ea3aff 100644
--- a/source4/lib/ldb/common/ldb_dn.c
+++ b/source4/lib/ldb/common/ldb_dn.c
@@ -630,7 +630,7 @@ const char *ldb_dn_get_casefold(struct ldb_dn *dn)
if (dn->casefold) return dn->casefold;
- if (dn->special) {
+ if (dn->special) {
dn->casefold = talloc_strdup(dn, dn->linearized);
if (!dn->casefold) return NULL;
dn->valid_case = true;
@@ -642,10 +642,14 @@ const char *ldb_dn_get_casefold(struct ldb_dn *dn)
}
if (dn->comp_num == 0) {
- dn->casefold = talloc_strdup(dn, "");
- if (!dn->casefold) return NULL;
- dn->valid_case = true;
- return dn->casefold;
+ if (dn->linearized && dn->linearized[0] == '\0') {
+ /* hmm a NULL dn, should we faild casefolding ? */
+ dn->casefold = talloc_strdup(dn, "");
+ return dn->casefold;
+ }
+ /* A DN must be NULL, special, or have components */
+ dn->invalid = true;
+ return NULL;
}
/* calculate maximum possible length of DN */