summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/Mapping
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-01-25 17:10:51 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-01-25 17:10:51 +0100
commit03ae7b654f62a37cc3fd637ab4f971128163f22a (patch)
tree0bfbbf63084192d3bce88690d97562c2dd404610 /apps/user_ldap/lib/Mapping
parentf469b3e9587e9eae2cce924241f90baa1da30b31 (diff)
downloadnextcloud-server-03ae7b654f62a37cc3fd637ab4f971128163f22a.tar.gz
nextcloud-server-03ae7b654f62a37cc3fd637ab4f971128163f22a.zip
Gracefully deny users or groups with too long DNs
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/lib/Mapping')
-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 8e7f1f8b137..6fb4a5436c3 100644
--- a/apps/user_ldap/lib/Mapping/AbstractMapping.php
+++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php
@@ -209,6 +209,17 @@ abstract class AbstractMapping {
* @return bool
*/
public function map($fdn, $name, $uuid) {
+ if(mb_strlen($fdn) > 255) {
+ \OC::$server->getLogger()->error(
+ 'Cannot map, because the DN exceeds 255 characters: {dn}',
+ [
+ 'app' => 'user_ldap',
+ 'dn' => $fdn,
+ ]
+ );
+ return false;
+ }
+
$row = array(
'ldap_dn' => $fdn,
'owncloud_name' => $name,