Skip to content

Commit

Permalink
fix(LDAP): escape DN on check-user
Browse files Browse the repository at this point in the history
the DN has to be escaped differently when used as a base and we were
missing it here in the search method call in the check-user command.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
  • Loading branch information
blizzz committed Mar 20, 2024
1 parent c451829 commit c2c27e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/user_ldap/lib/Command/CheckUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ private function updateUser(string $uid, OutputInterface $output): void {
$attrs = $access->userManager->getAttributes();
$user = $access->userManager->get($uid);
$avatarAttributes = $access->getConnection()->resolveRule('avatar');
$result = $access->search('objectclass=*', $user->getDN(), $attrs, 1, 0);
$baseDn = $this->helper->DNasBaseParameter($user->getDN());

Check notice

Code scanning / Psalm

PossiblyNullReference Note

Cannot call method getDN on possibly null value
$result = $access->search('objectclass=*', $baseDn, $attrs, 1, 0);
foreach ($result[0] as $attribute => $valueSet) {
$output->writeln(' ' . $attribute . ': ');
foreach ($valueSet as $value) {
Expand Down

0 comments on commit c2c27e1

Please sign in to comment.