Skip to content

Commit

Permalink
Bugfix: Unset aux groups when dropping the privileges
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanh committed Apr 13, 2024
1 parent 0fa8bbf commit 8ee2601
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion droppriv_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import (
)

func dropPrivileges(uid, gid int) error {
err := syscall.Setgid(gid)
err := syscall.Setgroups([]int{})
if err != nil {
return err
}

err = syscall.Setgid(gid)
if err != nil {
return err
}
Expand Down

0 comments on commit 8ee2601

Please sign in to comment.