From d4c49a3a60fac3c3e0b17386b8be8436ae1a1520 Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Thu, 4 Nov 2021 12:30:38 +0100 Subject: Put back length check to have a clear error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/user_ldap/lib/Mapping/AbstractMapping.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'apps/user_ldap') diff --git a/apps/user_ldap/lib/Mapping/AbstractMapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php index f578b553d54..18b76a0bf15 100644 --- a/apps/user_ldap/lib/Mapping/AbstractMapping.php +++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php @@ -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, -- cgit v1.2.3