From 0e79f6e735ca523edfa8842b868f7e971e4f0aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 27 Jan 2026 14:05:53 +0100 Subject: [PATCH] fix(user_ldap): Fix crash in some code path when a DN is longer that 64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UserConfig throws in this case. Signed-off-by: Côme Chilliet --- apps/user_ldap/lib/User/Manager.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/user_ldap/lib/User/Manager.php b/apps/user_ldap/lib/User/Manager.php index 539c667b897..0d83c29b7b4 100644 --- a/apps/user_ldap/lib/User/Manager.php +++ b/apps/user_ldap/lib/User/Manager.php @@ -166,8 +166,13 @@ class Manager { * @param string $id the Nextcloud username */ public function isDeletedUser(string $id): bool { - return $this->userConfig->getValueBool( - $id, 'user_ldap', 'isDeleted'); + try { + return $this->userConfig->getValueBool($id, 'user_ldap', 'isDeleted'); + } catch (\InvalidArgumentException $e) { + // Most likely the string is too long to be a valid user id + $this->logger->debug('Invalid id given to isDeletedUser', ['exception' => $e]); + return false; + } } /**