ldb: do not allow adding a DN as a base to itself
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sat, 6 Jul 2019 11:24:43 +0000 (23:24 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 10 Jul 2019 04:32:13 +0000 (04:32 +0000)
commit19a13cbe0681b3996c33f7449f69b0fb0dc5d640
tree2bd8b38a5e17958eebf850006d9b561081c09943
parent09ddad6c14db6e3310b663f6203582104d85db45
ldb: do not allow adding a DN as a base to itself

If you try to add a dn to itself, it expands as it goes. The resulting
loop cannot end well.

It looks like this in Python:

    dn = ldb.Dn(ldb.Ldb(), 'CN=y,DC=x')
    dn.add_base(dn)

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
lib/ldb/common/ldb_dn.c