LdapConnection: disallow an empty root DN

fixes #11114
This commit is contained in:
Alexander A. Klimov 2016-02-09 10:29:08 +01:00
parent d9fd5378a4
commit 34afcc07b3
1 changed files with 6 additions and 0 deletions

View File

@ -15,6 +15,7 @@ use Icinga\Data\Sortable;
use Icinga\Data\Filter\Filter;
use Icinga\Data\Filter\FilterChain;
use Icinga\Data\Filter\FilterExpression;
use Icinga\Exception\ConfigurationError;
use Icinga\Exception\ProgrammingError;
use Icinga\Protocol\Ldap\LdapException;
@ -168,7 +169,12 @@ class LdapConnection implements Selectable, Inspectable
$this->hostname = $config->hostname;
$this->bindDn = $config->bind_dn;
$this->bindPw = $config->bind_pw;
if (empty($config->root_dn)) {
throw new ConfigurationError('LDAP root DN missing');
}
$this->rootDn = $config->root_dn;
$this->port = $config->get('port', 389);
$this->encryption = $config->encryption;