Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Deleted ldap account is not listed in disabled users with markRemnantsAsDisabled = 1 #50165

Open
kesselb opened this issue Jan 13, 2025 · 2 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 28-feedback bug feature: ldap feature: users and groups

Comments

@kesselb
Copy link
Contributor

kesselb commented Jan 13, 2025

Bug description

Deleted ldap account is not listed in disabled users with markRemnantsAsDisabled = 1

Steps to reproduce

  1. Have an LDAP confguration
  2. Modify the config per cli: occ ldap:set-config s01 markRemnantsAsDisabled 1
  3. Delete a users on LDAP
  4. Ensure the user is known as deleted: occ ldap:check-user $USERID
  5. Open the user management and select "disabled users"

Expected behavior

The user should appear there ;)

Nextcloud Server version

28

Additional info

  1. Weird implementation of the markRemnantsAsDisabled flag

if ((int)$this->getAccess(array_key_first($this->backends) ?? '')->connection->markRemnantsAsDisabled !== 1) {
return [];
}

It's possible to have more than one ldap backend. The above code seems to check if the first ldap connection have the flag set. It should take all backends into account.

Likely resolved by #46992.

  1. Wrong enable state for ldap remnants

stable28:

$data['enabled'] = $this->config->getUserValue($targetUserObject->getUID(), 'core', 'enabled', 'true') === 'true';

master:

$data['enabled'] = $this->config->getUserValue($targetUserObject->getUID(), 'core', 'enabled', 'true') === 'true';

The controller reads the disable state from the oc_preferences table. That does not take the disabled state for ldap remnants into account.

Apparently the users are returned by the endpoint, but filtered out by the frontend because they have enabled = true. Using $data['enabled'] = $targetUserObject->isEnabled(); makes it work. However there are some menu options, like enable user, that needs to be hidden for ldap remnants.

@kesselb kesselb added 0. Needs triage Pending check for reproducibility or if it fits our roadmap 28-feedback bug labels Jan 13, 2025
@joshtrichards
Copy link
Member

Related to #46992?

@kesselb
Copy link
Contributor Author

kesselb commented Jan 13, 2025

Related to #46992?

Yep, thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 28-feedback bug feature: ldap feature: users and groups
Projects
None yet
Development

No branches or pull requests

2 participants