mirror of
https://tildegit.org/solderpunk/molly-brown
synced 2024-05-11 15:26:03 +02:00
Only drop supplementary groups if root is amongst them.
This commit is contained in:
parent
0274ef8f35
commit
c50accfaec
|
@ -77,12 +77,10 @@ func DropPrivs(ui userInfo) error {
|
|||
}
|
||||
|
||||
// Drop supplementary groups
|
||||
if ui.root_supp_goup {
|
||||
err := syscall.Setgroups([]int{})
|
||||
if err != nil {
|
||||
// Log failure
|
||||
log.Println("Could not unset supplementary groups: " + err.Error())
|
||||
// Make this fatal if root was amongst supplementary groups
|
||||
if ui.root_supp_group {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue