Fix new profiles with custom config and implement review suggestions

This commit is contained in:
Daniel
2021-02-11 14:53:33 +01:00
parent 7d6d679929
commit 9bf89c32c0
7 changed files with 108 additions and 51 deletions

View File

@@ -47,6 +47,11 @@ func (p *Process) GetProfile(ctx context.Context) (changed bool, err error) {
profileID = profile.PortmasterAppProfileID
case strings.Contains(p.Path, "portmaster-notifier"):
profileID = profile.PortmasterNotifierProfileID
default:
// Unexpected binary from within the Portmaster updates directpry.
log.Warningf("process: unexpected binary in the updates directory: %s", p.Path)
// TODO: Assign a fully restricted profile in the future when we are
// sure that we won't kill any of our own things.
}
}
}
@@ -74,7 +79,7 @@ func (p *Process) UpdateProfileMetadata() {
}
// Update metadata of profile.
metadataUpdated := localProfile.UpdateMetadata(p.Name, p.Path)
metadataUpdated := localProfile.UpdateMetadata(p.Path)
// Mark profile as used.
profileChanged := localProfile.MarkUsed()