summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2021-11-04 12:30:38 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2021-12-13 09:39:23 +0100
commita0db2a248c59bb2dabfe5de76cd2cf0ec1028bbe (patch)
treeadf18013da2de1c27eb874b10725e6370c7f7536 /apps/user_ldap/lib
parent189852b549890cb2654ff8f9dd30906984b92292 (diff)
downloadnextcloud-server-a0db2a248c59bb2dabfe5de76cd2cf0ec1028bbe.tar.gz
nextcloud-server-a0db2a248c59bb2dabfe5de76cd2cf0ec1028bbe.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.php11
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 a2cc278aad5..d3ace159b0c 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,