Skip to content

Commit f2a5a8d

Browse files
committed
fix(user_ldap): Fix crash in some code path when a DN is longer that 64
UserConfig throws in this case. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent a17f4d4 commit f2a5a8d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

apps/user_ldap/lib/User/Manager.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,13 @@ function ($list, $attribute) {
166166
* @param string $id the Nextcloud username
167167
*/
168168
public function isDeletedUser(string $id): bool {
169-
return $this->userConfig->getValueBool(
170-
$id, 'user_ldap', 'isDeleted');
169+
try {
170+
return $this->userConfig->getValueBool($id, 'user_ldap', 'isDeleted');
171+
} catch (\InvalidArgumentException $e) {
172+
// Most likely the string is too long to be a valid user id
173+
$this->logger->debug('Invalid id given to isDeletedUser', ['exception' => $e]);
174+
return false;
175+
}
171176
}
172177

173178
/**

0 commit comments

Comments
 (0)