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

fix(user_ldap): Do not block access to configuration page upon bad configuration #43527

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

come-nc
Copy link
Contributor

@come-nc come-nc commented Feb 12, 2024

Summary

It should be possible to access configuration page with the local admin
user even when LDAP configuration is not valid.
This prevent ldap backend from throwing in countUsers to allow this.

Checklist

…nfiguration

It should be possible to access configuration page with the local admin
 user even when LDAP configuration is not valid.
This prevent ldap backend from throwing in countUsers to allow this.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc added the 3. to review Waiting for reviews label Feb 12, 2024
@come-nc come-nc self-assigned this Feb 12, 2024
@come-nc come-nc added this to the Nextcloud 29 milestone Feb 12, 2024
@come-nc come-nc requested review from a team, ArtificialOwl, nfebe and sorbaugh and removed request for a team February 12, 2024 13:21
@come-nc
Copy link
Contributor Author

come-nc commented Feb 12, 2024

/backport to stable28

@come-nc
Copy link
Contributor Author

come-nc commented Feb 12, 2024

/backport to stable27

@come-nc
Copy link
Contributor Author

come-nc commented Feb 12, 2024

/backport to stable26

@susnux susnux requested a review from blizzz February 14, 2024 18:50
Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a comment in code, for one would not be able to tell why the Exception is caught here and nowhere else.

Without having a better idea, it also feels weird to solve it this way, because

  • the countUsers() method is not hard wired to the settings page
  • a change there can have the side effect to make this solutions fail as side effect
  • for completeness, side effects from this are also possible, but unlikely to be problematic

Not sure if it is possible to catch is somewhere higher, more to the configuration logic?

@come-nc
Copy link
Contributor Author

come-nc commented Feb 19, 2024

Well the method was not documented to throw anything, but is documented to return false if an error happens.

@blizzz
Copy link
Member

blizzz commented Feb 19, 2024

I am not sure the throw tag was set consistently back then.

@Altahrim Altahrim mentioned this pull request Mar 12, 2024
@come-nc
Copy link
Contributor Author

come-nc commented Mar 12, 2024

@blizzz Is it a strong no on this one?
Do you have another approach which would allow the admin to fix his configuration through GUI?

This was referenced Mar 14, 2024
@blizzz
Copy link
Member

blizzz commented Mar 21, 2024

It is not a strong no, but it would cause me stomachaches. Unfortunately without looking into the matter I have no better idea at the moment either, and it is unlikely to change in the near future. That said a pragmatic approach is to go ahead with this solution, but opening an issue to have an improvement in mind at least. And add some comments into the code to clearly state the intention and meaning of the change, for by looking at it you would not have the slightest idea about it's actual purpose.

@Altahrim Altahrim mentioned this pull request Mar 25, 2024
@skjnldsv skjnldsv mentioned this pull request Mar 28, 2024
81 tasks
@come-nc come-nc modified the milestones: Nextcloud 29, Nextcloud 30 Mar 28, 2024
This was referenced Jul 30, 2024
@Altahrim Altahrim mentioned this pull request Aug 5, 2024
@skjnldsv skjnldsv added 2. developing Work in progress stale Ticket or PR with no recent activity and removed 3. to review Waiting for reviews labels Aug 6, 2024
@Altahrim Altahrim mentioned this pull request Aug 7, 2024
@skjnldsv skjnldsv mentioned this pull request Aug 13, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 31 Aug 14, 2024
@skjnldsv skjnldsv marked this pull request as draft November 15, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress backport-request bug feature: ldap stale Ticket or PR with no recent activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Nextcloud inaccessible with erroneous LDAP configuration
5 participants