Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
U
userutils
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 6
    • Issues 6
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 3
    • Merge Requests 3
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • redox-os
  • userutils
  • Issues
  • #37

Closed
Open
Opened Jan 01, 2021 by SamwiseFilmore@MggMugginsDeveloper

Move AllGroupsExt into redox_users and Prevent Unintended Behavior

I think the functionality that's provided by AllGroupsExt is valuable enough that it could possibly be used by other users of redox_users. It should probably be moved out of this crate and into that one.

@omac777 Brought up a couple of good points:

  • for atomicity's sake, all groups should exist before you add the user to the existing groups
  • ensure when adding user to a group, the user should not [be in the group] beforehand. [If] the user already exists, return an error condition useralreadyexists of some sort and recover gracefully continuing to add the user to other groups.

There's a chance without doing the above that you will be adding the user to some groups, but the non-existing group will fail the operation and the user might not get added to the remaining existing groups.

There's a chance that you might double-add a user to a group the way things are read.

For all the situations in this crate, error conditions are always fatal. However, if/when these functions get moved, they should be improved in these ways to prevent these situations from happening, since one of these returning an error condition doesn't necessarily prevent a save being called.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: redox-os/userutils#37