From: Côme Chilliet Date: Thu, 4 Nov 2021 11:30:38 +0000 (+0100) Subject: Put back length check to have a clear error X-Git-Tag: v21.0.8rc1~40^2~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8367bda4454d07613126bbcc512f8fc568d79149;p=nextcloud-server.git Put back length check to have a clear error Signed-off-by: Côme Chilliet --- diff --git a/apps/user_ldap/lib/Mapping/AbstractMapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php index ce20983937a..966d930481c 100644 --- a/apps/user_ldap/lib/Mapping/AbstractMapping.php +++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php @@ -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,