mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
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,".
This commit is contained in:
parent
bce8017ca9
commit
e315aceda3
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user