Put back length check to have a clear error

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2021-11-04 12:30:38 +01:00
parent 189852b549
commit a0db2a248c
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

View file

@ -355,6 +355,17 @@ abstract class AbstractMapping {
* @return bool
*/
public function map($fdn, $name, $uuid) {
if (mb_strlen($fdn) > 4096) {
\OC::$server->getLogger()->error(
'Cannot map, because the DN exceeds 4096 characters: {dn}',
[
'app' => 'user_ldap',
'dn' => $fdn,
]
);
return false;
}
$row = [
'ldap_dn_hash' => $this->getDNHash($fdn),
'ldap_dn' => $fdn,