Skip to content

Commit

Permalink
Improve GID handling
Browse files Browse the repository at this point in the history
  • Loading branch information
NHAS committed Aug 7, 2023
1 parent 643e740 commit 833ebb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (a Acls) GetUserGroups(username string) (result []string) {
type Config struct {
path string
Socket string `json:",omitempty"`
GID int `json:",omitempty"`
GID *int `json:",omitempty"`
CheckUpdates bool `json:",omitempty"`
Proxied bool
ExposePorts []string `json:",omitempty"`
Expand Down
6 changes: 4 additions & 2 deletions pkg/control/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ func StartControlSocket() error {
return err
}

if err := os.Chown(config.Values().Socket, -1, config.Values().GID); err != nil {
return err
if config.Values().GID != nil {
if err := os.Chown(config.Values().Socket, -1, *config.Values().GID); err != nil {
return err
}
}

log.Println("Started control socket: \n\t\t\t", config.Values().Socket)
Expand Down

0 comments on commit 833ebb2

Please sign in to comment.