]> source.dussan.org Git - nextcloud-server.git/commitdiff
Put back length check to have a clear error
authorCôme Chilliet <come.chilliet@nextcloud.com>
Thu, 4 Nov 2021 11:30:38 +0000 (12:30 +0100)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 14 Dec 2021 09:58:22 +0000 (10:58 +0100)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
apps/user_ldap/lib/Mapping/AbstractMapping.php

index ce20983937a5c0cd5a3f6c7d31661b516911a74a..966d930481c9c6daf2f03880fb686f0b498fda7d 100644 (file)
@@ -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,