]> 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>
Mon, 13 Dec 2021 08:39:23 +0000 (09:39 +0100)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
apps/user_ldap/lib/Mapping/AbstractMapping.php

index a2cc278aad5fe8bb3d651bf73c130c053e023298..d3ace159b0c7d0ca5c96e1eb57d4d709da340c08 100644 (file)
@@ -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,