Automatically fix chrome-sandbox permissions on older kernels

This commit is contained in:
Patrick Pacher
2021-05-12 18:52:31 +02:00
parent 168ef32c44
commit 9751a5244d
6 changed files with 122 additions and 32 deletions

View File

@@ -21,6 +21,7 @@ import (
"github.com/safing/portbase/notifications"
"github.com/safing/portbase/rng"
"github.com/safing/portbase/updater"
"github.com/safing/portmaster/updates/helper"
)
const (
@@ -65,14 +66,16 @@ func upgrader(_ context.Context, _ interface{}) error {
binBaseName := strings.Split(filepath.Base(os.Args[0]), "_")[0]
switch binBaseName {
case "portmaster-core":
err = upgradeCoreNotify()
if err != nil {
if err := upgradeCoreNotify(); err != nil {
log.Warningf("updates: failed to notify about core upgrade: %s", err)
}
if err := helper.EnsureChromeSandboxPermissions(registry); err != nil {
log.Warningf("updates: failed to handle electron upgrade: %s", err)
}
case "spn-hub":
err = upgradeHub()
if err != nil {
if err := upgradeHub(); err != nil {
log.Warningf("updates: failed to initiate hub upgrade: %s", err)
}
}