summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
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-11-23 09:20:29 +0100
commitd4c49a3a60fac3c3e0b17386b8be8436ae1a1520 (patch)
tree918a24b264fb96f699dce6308fa690d9ffc87c09 /apps/user_ldap
parentce5192a46163992e7270b6532b60f0e8c3ded2e4 (diff)
downloadnextcloud-server-d4c49a3a60fac3c3e0b17386b8be8436ae1a1520.tar.gz
nextcloud-server-d4c49a3a60fac3c3e0b17386b8be8436ae1a1520.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')
-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 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,