Skip to content
Merged
Prev Previous commit
Next Next commit
Put back length check to have a clear error
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Dec 13, 2021
commit a0db2a248c59bb2dabfe5de76cd2cf0ec1028bbe
11 changes: 11 additions & 0 deletions apps/user_ldap/lib/Mapping/AbstractMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,17 @@ public function getList($offset = null, $limit = null) {
* @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,
Expand Down