diff --git a/CHANGELOG.md b/CHANGELOG.md index a75ffcc3..1f537699 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,8 @@ and this project adheres to ### Fixed -- User-specific blocked services not applying correctly. +- User-specific blocked services not applying correctly ([#4945], [#4982], + [#4983]). - `only application/json is allowed` errors in various APIs ([#4970]). [#4970]: https://github.com/AdguardTeam/AdGuardHome/issues/4970 @@ -96,6 +97,9 @@ All JSON APIs that expect a body now check if the request actually has [#2993]: https://github.com/AdguardTeam/AdGuardHome/issues/2993 [#4927]: https://github.com/AdguardTeam/AdGuardHome/issues/4927 [#4930]: https://github.com/AdguardTeam/AdGuardHome/issues/4930 +[#4945]: https://github.com/AdguardTeam/AdGuardHome/issues/4945 +[#4982]: https://github.com/AdguardTeam/AdGuardHome/issues/4982 +[#4983]: https://github.com/AdguardTeam/AdGuardHome/issues/4983 [ms-v0.107.14]: https://github.com/AdguardTeam/AdGuardHome/milestone/50?closed=1 diff --git a/internal/home/clients.go b/internal/home/clients.go index 61802831..7396e8c6 100644 --- a/internal/home/clients.go +++ b/internal/home/clients.go @@ -244,10 +244,6 @@ func (clients *clientsContainer) addFromConfig(objects []*clientObject) { } } - if cli.BlockedServices == nil && cli.UseOwnBlockedServices { - cli.BlockedServices = []string{} - } - for _, t := range o.Tags { if clients.allTags.Has(t) { cli.Tags = append(cli.Tags, t) diff --git a/internal/home/dns.go b/internal/home/dns.go index 06c38bcc..c304f6cc 100644 --- a/internal/home/dns.go +++ b/internal/home/dns.go @@ -358,7 +358,13 @@ func applyAdditionalFiltering(clientIP net.IP, clientID string, setts *filtering log.Debug("%s: using settings for client %q (%s; %q)", pref, c.Name, clientIP, clientID) if c.UseOwnBlockedServices { - Context.filters.ApplyBlockedServices(setts, c.BlockedServices) + // TODO(e.burkov): Get rid of this crutch. + svcs := c.BlockedServices + if svcs == nil { + svcs = []string{} + } + Context.filters.ApplyBlockedServices(setts, svcs) + log.Debug("%s: services for client %q set: %s", pref, c.Name, svcs) } setts.ClientName = c.Name