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-11-23 09:20:29 +0100 |
commit | d4c49a3a60fac3c3e0b17386b8be8436ae1a1520 (patch) | |
tree | 918a24b264fb96f699dce6308fa690d9ffc87c09 /apps/user_ldap | |
parent | ce5192a46163992e7270b6532b60f0e8c3ded2e4 (diff) | |
download | nextcloud-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.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 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, |