Skip to content

Fix ldap admin privileges update bug #27051

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

Merged
merged 6 commits into from
Oct 1, 2023

Conversation

CaiCandong
Copy link
Member

@CaiCandong CaiCandong commented Sep 13, 2023

When the user does not set a username lookup condition, LDAP will get an empty string "" for the user, hence the following code

if isExist, err := user_model.IsUserExist(db.DefaultContext, 0, sr.Username)

The user presence determination will always be nonexistent, so updates to user information will never be performed.

Fix #27049

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 13, 2023
@lunny
Copy link
Member

lunny commented Sep 13, 2023

Could you add some tests?

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 16, 2023
@CaiCandong
Copy link
Member Author

@lng2020, I don't have time to write test cases. Could you help me implement it?

@CaiCandong CaiCandong requested a review from lng2020 September 25, 2023 14:08
@CaiCandong
Copy link
Member Author

Could you add some tests?

Writing tests for this function is a bit difficult.

@6543
Copy link
Member

6543 commented Oct 1, 2023

should we backport it?

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Oct 1, 2023
@6543 6543 enabled auto-merge (squash) October 1, 2023 10:24
@6543 6543 added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 1, 2023
@6543 6543 merged commit 7ad3156 into go-gitea:main Oct 1, 2023
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 1, 2023
@CaiCandong CaiCandong deleted the bugfix/Fix-ldap-admin-update-bug branch October 3, 2023 03:21
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Dec 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/authentication type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LDAP admin updata bug
5 participants