summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-19 14:49:23 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-19 17:53:23 +0200
commite315aceda357711284da08094f80b1e03346fef0 (patch)
treed29059e6de66ecc514d657fe66576431e06a82f2 /source4
parentbce8017ca9f64ce8e3bf94312d69f97e87d3d41a (diff)
downloadsamba-e315aceda357711284da08094f80b1e03346fef0.tar.gz
samba-e315aceda357711284da08094f80b1e03346fef0.tar.bz2
samba-e315aceda357711284da08094f80b1e03346fef0.zip
ldb:ldb_dn.c - don't support "ldb_dn_add_child" on a "" parent DN
It's meaningless and could end in DNs as "cn=child,".
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/common/ldb_dn.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c
index 00646f6ba5..5ce735f145 100644
--- a/source4/lib/ldb/common/ldb_dn.c
+++ b/source4/lib/ldb/common/ldb_dn.c
@@ -1488,6 +1488,10 @@ bool ldb_dn_add_child(struct ldb_dn *dn, struct ldb_dn *child)
unsigned int n;
long long int i, j;
+ if (dn->comp_num == 0) {
+ return false;
+ }
+
if ( ! ldb_dn_validate(child)) {
return false;
}
@@ -1534,6 +1538,9 @@ bool ldb_dn_add_child(struct ldb_dn *dn, struct ldb_dn *child)
}
if (dn->linearized) {
+ if (dn->linearized[0] == '\0') {
+ return false;
+ }
s = ldb_dn_get_linearized(child);
if ( ! s) {