Put back length check to have a clear error

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/30261/head
Côme Chilliet 2021-11-04 12:30:38 +07:00
parent dd8d90923e
commit 8367bda445
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
1 changed files with 11 additions and 0 deletions

@ -356,6 +356,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,