Skip to content

Deleted user is being used in branch protection whitelisting #19094

Closed
@plsnp

Description

@plsnp

Gitea Version

1.14.6 built with go1.16.7

Git Version

2.34.1

Operating System

SUSE Linux Enterprise Server 15 SP3

How are you running Gitea?

sudo zypper addrepo https://download.opensuse.org/repositories/devel:tools:scm/openSUSE_Leap_15.3/devel:tools:scm.repo
sudo zypper refresh
sudo zypper install gitea
sudo systemctl enable gitea --now

Database

SQLite

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://bpa.st/UZYA

Description

  1. some users were created
  2. some branches were protected, but some users whitelisted (user 1 and 2)
  3. ldap was activated, but conflicted with existing user. user 1 was deleted through GUI (later re-added over ldap as user 13)
  4. whitelist shows only user 2
  5. trying to add user 3 to whitelist
  6. 500 internal server error.
  7. LOG: 2022/03/15 14:49:15 ..._protected_branch.go:266:SettingsProtectedBranchPost() [E] UpdateProtectBranch: GetUserByID [user_id: 1, repo_id: 3]: user does not exist [uid: 1, name: , keyid: 0]
  8. in html it shows that user 1 and 2 were send to html in value field
  9. downloaded gitea sqlite database, table protected_branch, column whitelist_user_i_ds shows user 1 active on some branches

Possible cause: when deleted user, user is not removed from whitelisted branches

I searched for bug but couldn't find. Sorry if this has already been fixed in the meanwhile, i can't try the latest version at the moment.

Screenshots

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions