-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add option to prevent LDAP from deactivating everything on empty search #9879
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should require a migration step, I think. What should the migration value be? I vote for AllowDeactivateAll=false
.
Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
It's actually not in the db like that. It's JSON so it will default to false already. |
Codecov Report
@@ Coverage Diff @@
## master #9879 +/- ##
==========================================
- Coverage 42.27% 42.26% -0.01%
==========================================
Files 605 605
Lines 79253 79259 +6
==========================================
- Hits 33501 33500 -1
- Misses 41622 41626 +4
- Partials 4130 4133 +3
Continue to review full report at Codecov.
|
Is it at all possible to get this fix into a 1.10 release? |
We could probably backport it to 1.11? I think 1.10 is now security fixes only. |
Sounds like we're close to 1.11, but if anybody wants port this to 1.10.4 and fix the conflicts or do it by hand, I have no problem reviewing the PR from zero. |
@zeripath If we marked this as feature, I don't think we should send backport to v1.11. Or we may should label this as bug. |
…ng everything on empty search)
@dioss-Machiel Looks like it applied cleanly to release/v1.10? |
I applied it manually, seems to be fine. |
…ch (go-gitea#9879) * Add option to prevent LDAP from deactivating everything on empty search * Update options/locale/locale_en-US.ini Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
I've marked this as a bug. I'm not sure where the bug is because LDAP shouldn't be returning an empty result without an error. |
It appears that some LDAPs will simply return an empty search results if there is an error during searching rather than report the error. In those circumstances Gitea would completely deactivate all LDAP users.
This is clearly not ideal - add a configuration option to LDAP configuration which will mean that by default an empty search results will not deactivate any users and instead an error will be logged. An authentication option can be turned on for those situations where this behaviour would be intended.
Fix #7949