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

Inconsistent e-mail address sync from LDAP #18603

Closed
pboguslawski opened this issue Feb 4, 2022 · 1 comment · Fixed by #18786
Closed

Inconsistent e-mail address sync from LDAP #18603

pboguslawski opened this issue Feb 4, 2022 · 1 comment · Fixed by #18786
Labels
Milestone

Comments

@pboguslawski
Copy link
Contributor

Gitea Version

1.16-rc1

Git Version

No response

Operating System

No response

How are you running Gitea?

Compiled from source.

Database

No response

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

According to

#4497 (comment)

LDAP sync cron task synchronizes only primary user mail; current sync code

https://github.com/go-gitea/gitea/blob/main/services/auth/source/ldap/source_sync.go#L157

updates only email column in user table and does not update extra e-mails nor is_primary state in this table.

There should be separate new method called there for consistent updating user primary e-mail (i.e. in users table and extra emails table with is_primary updating). LDAP should not add changed e-mail as new e-mail (like manual changing user email in admin panel does after #17549) but should update current primary e-mail only like it was working in gitea 1.13.

Same solution should be applied to LDAP sync code on user login if #18452 (comment) is merged.

To be considered: separate storing user primary e-mail in two separate tables is error prone. It should be kept in only one place problably to avoid such bugs.

Screenshots

No response

@lunny
Copy link
Member

lunny commented Feb 16, 2022

The email in the user table should be deleted in future PRs.

@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants