Use a special profile for system resolvers

This commit is contained in:
Daniel
2021-03-20 22:32:44 +01:00
parent fbf666ee68
commit a38f546da8
4 changed files with 48 additions and 0 deletions

View File

@@ -11,6 +11,11 @@ const (
// SystemProfileName is the name used for the system/kernel.
SystemProfileName = "Operating System"
// SystemResolverProfileID is the profile ID used for the system's DNS resolver.
SystemResolverProfileID = "_system-resolver"
// SystemResolverProfileName is the name used for the system's DNS resolver.
SystemResolverProfileName = "System DNS Client"
// PortmasterProfileID is the profile ID used for the Portmaster Core itself.
PortmasterProfileID = "_portmaster"
// PortmasterProfileName is the name used for the Portmaster Core itself.
@@ -35,6 +40,8 @@ func updateSpecialProfileMetadata(profile *Profile, binaryPath string) (ok, chan
newProfileName = UnidentifiedProfileName
case SystemProfileID:
newProfileName = SystemProfileName
case SystemResolverProfileID:
newProfileName = SystemResolverProfileName
case PortmasterProfileID:
newProfileName = PortmasterProfileName
case PortmasterAppProfileID:
@@ -68,6 +75,9 @@ func getSpecialProfile(profileID, linkedPath string) *Profile {
case SystemProfileID:
return New(SourceLocal, SystemProfileID, linkedPath, nil)
case SystemResolverProfileID:
return New(SourceLocal, SystemResolverProfileID, linkedPath, nil)
case PortmasterProfileID:
profile := New(SourceLocal, PortmasterProfileID, linkedPath, nil)
profile.Internal = true