Skip to content

Conversation

@sireeshajonnalagadda
Copy link
Contributor

Description
Fixing #1514

Issue:
The common-utils feature was failing with groupadd: GID '100' already exists and usermod: UID '1000' already exists errors when trying to create users with GID 100 or modify existing users with conflicting UIDs.

Root Cause:
GID 100 is typically reserved for the users group in most Linux distributions
The script attempted to create new groups with existing GIDs without checking if they already exist
UID conflicts occurred when trying to modify users to UIDs already in use by other users

Changes Made:

  1. Enhanced Group Name Detection (main.sh)
    Purpose: Properly detect existing group names for users instead of assuming the group name matches the username.
  2. Added GID Conflict Handling
    Purpose: Use existing groups (like users with GID 100) instead of failing when trying to create them.
  3. Added UID Conflict Prevention
    Purpose: Prevent UID conflicts by checking if the target UID is already in use by another user.
  4. Added Test Scenario and Test Dockerfile
    Purpose: Test the specific case where GID 100 is requested to ensure the feature handles it gracefully.

Checklist:
Changes worked as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant