LdapUserGroupBackend: Fix exception when searching for single chars

refs #10370
This commit is contained in:
Johannes Meyer 2015-11-09 16:00:24 +01:00
parent 4341eef4b1
commit ffcc2ed56b

View File

@ -9,6 +9,7 @@ use Icinga\Application\Logger;
use Icinga\Data\ConfigObject;
use Icinga\Exception\ConfigurationError;
use Icinga\Exception\ProgrammingError;
use Icinga\Protocol\Ldap\LdapException;
use Icinga\Repository\LdapRepository;
use Icinga\Repository\RepositoryQuery;
use Icinga\User;
@ -467,6 +468,7 @@ class LdapUserGroupBackend extends LdapRepository implements UserGroupBackendInt
*/
protected function persistUserName($name)
{
try {
$userDn = $this->ds
->select()
->from($this->userClass, array())
@ -486,6 +488,9 @@ class LdapUserGroupBackend extends LdapRepository implements UserGroupBackendInt
if ($groupDn) {
return $groupDn;
}
} catch (LdapException $_) {
// pass
}
Logger::debug('Unable to persist uid or gid "%s" in repository "%s". No DN found.', $name, $this->getName());
return $name;