dns_server: Be strict when constructing a LDB DN from an untrusted DNS name
authorAndrew Bartlett <abartlet@samba.org>
Mon, 2 Jul 2018 04:49:37 +0000 (16:49 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 15 Aug 2018 05:08:24 +0000 (07:08 +0200)
commitaa01203ff51ec49dfdfeed6ab02bbe0cb3198d70
treefe2206d66f0650b019a19958f932b5d873ddf794
parentbdbb9422c0430d74c3173822257e23a9dfb2713e
dns_server: Be strict when constructing a LDB DN from an untrusted DNS name

This changes our DNS server to be much more careful when constructing DNS names
into LDB DN values.

This avoids a segfault deep in the LDB code if the ldb_dn_get_casefold() fails there.

A seperate patch will address that part of the issue, and a later patch
will re-work this code to use single API: ldb_dn_add_child_val().  This
is not squahed with this work because this patch does not rely on a new
LDB release, and so may be helpful for a backport.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13466

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/dns_server/dnsserver_common.c