mirror of
https://tildegit.org/solderpunk/molly-brown
synced 2024-05-25 12: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
|
// Drop supplementary groups
|
||||||
err := syscall.Setgroups([]int{})
|
if ui.root_supp_goup {
|
||||||
if err != nil {
|
err := syscall.Setgroups([]int{})
|
||||||
// Log failure
|
if err != nil {
|
||||||
log.Println("Could not unset supplementary groups: " + err.Error())
|
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
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue