diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2021-11-04 12:30:38 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2021-12-14 10:58:22 +0100 |
commit | 8367bda4454d07613126bbcc512f8fc568d79149 (patch) | |
tree | 178d7281523181331376329b1e152391a3d75414 /apps/user_ldap/lib | |
parent | dd8d90923e03d13dcfb1dfd033eb0024aa4e80e0 (diff) | |
download | nextcloud-server-8367bda4454d07613126bbcc512f8fc568d79149.tar.gz nextcloud-server-8367bda4454d07613126bbcc512f8fc568d79149.zip |
Put back length check to have a clear error
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r-- | apps/user_ldap/lib/Mapping/AbstractMapping.php | 11 |
1 files changed, 11 insertions, 0 deletions
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, |