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

Don't delete empty groups from database #757

Open
adombeck opened this issue Jan 27, 2025 · 2 comments
Open

Don't delete empty groups from database #757

adombeck opened this issue Jan 27, 2025 · 2 comments
Labels
bug Something isn't working jira

Comments

@adombeck
Copy link
Contributor

adombeck commented Jan 27, 2025

When a user logs in, we fetch the groups from the provider and update our database accordingly. When this causes a user to be removed from an authd group and that group doesn't have any other users in it, it's currently removed from our database . That's an issue for two reasons:

  1. The next time a user who is a member of that group logs in, a new random GID is generated for that group, which means that any existing files owned by the group won't be accessible to members of the group anymore.
  2. Whenever a another group is added, the random GID generated for that group can by chance be the same as the GID of the deleted group, allowing members access to existing files owned by the deleted group.

Existing releases are not affected by this, only current main is, because we only generate random GIDs since #663 was merged.

UDENG-5873

@adombeck
Copy link
Contributor Author

adombeck commented Jan 27, 2025

I think we should fix this the same way we plan to support "deleting" users from the database via a command-line tool (#640), i.e. by marking the group as "disabled" in our database, which allows us to (1.) re-use the GID when it's added again, and (2.) include the GIDs of disabled groups when checking for GID conflicts.

@adombeck adombeck added bug Something isn't working jira labels Jan 27, 2025
@adombeck
Copy link
Contributor Author

Actually, I don't see a difference between a "disabled" group and a group which just doesn't have any members. Unless I'm missing something, we don't need to mark it as disabled after all, and just keep the empty group in the database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jira
Projects
None yet
Development

No branches or pull requests

1 participant