Skip to content

Commit

Permalink
Revert "fix: Allow accounts to belong to GID 0"
Browse files Browse the repository at this point in the history
This reverts commit 162b636.
  • Loading branch information
EyeCantCU committed Nov 18, 2024
1 parent 162b636 commit f9e43fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/build/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ func appendGroup(groups []passwd.GroupEntry, group types.Group) []passwd.GroupEn
}

func userToUserEntry(user types.User) passwd.UserEntry {
if user.GID == 0 {
user.GID = user.UID
}
if user.Shell == "" {
user.Shell = "/bin/sh"
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/build/types/image_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ func (ic *ImageConfiguration) Validate() error {
if g.GroupName == "" {
return fmt.Errorf("configured group %v has no configured group name", g)
}

if g.GID == 0 {
return fmt.Errorf("configured group %v has GID 0", g)
}
}
return nil
}
Expand Down

0 comments on commit f9e43fa

Please sign in to comment.