Check for errors before modifying proc attrs
@@ -241,10 +241,10 @@ func (pb *PluginBroker) loadNotificationPlugin(name string, binaryPath string) (
}
cmd := exec.Command(binaryPath)
cmd.SysProcAttr, err = getProcessAtr(pb.pluginProcConfig.User, pb.pluginProcConfig.Group)
- cmd.SysProcAttr.Credential.NoSetGroups = true
if err != nil {
return nil, errors.Wrap(err, "while getting process attributes")
}
+ cmd.SysProcAttr.Credential.NoSetGroups = true
pb.pluginMap[name] = &NotifierPlugin{}
l := log.New()
err = types.ConfigureLogger(l)
