mirror of
https://github.com/safing/portmaster
synced 2025-09-02 02:29:12 +00:00
Fix intel fetching input validation, improve logging
This commit is contained in:
parent
b3f7ed8586
commit
6c849ab607
1 changed files with 4 additions and 9 deletions
|
@ -317,14 +317,13 @@ func (e *Entity) getDomainLists(ctx context.Context) {
|
||||||
e.loadDomainListOnce.Do(func() {
|
e.loadDomainListOnce.Do(func() {
|
||||||
var domainsToInspect = []string{domain}
|
var domainsToInspect = []string{domain}
|
||||||
|
|
||||||
if e.checkCNAMEs {
|
if e.checkCNAMEs && len(e.CNAME) > 0 {
|
||||||
log.Tracer(ctx).Tracef("intel: CNAME filtering enabled, checking %v too", e.CNAME)
|
log.Tracer(ctx).Tracef("intel: CNAME filtering enabled, checking %v too", e.CNAME)
|
||||||
domainsToInspect = append(domainsToInspect, e.CNAME...)
|
domainsToInspect = append(domainsToInspect, e.CNAME...)
|
||||||
}
|
}
|
||||||
|
|
||||||
var domains []string
|
var domains []string
|
||||||
if e.resolveSubDomainLists {
|
if e.resolveSubDomainLists {
|
||||||
log.Tracer(ctx).Trace("intel: subdomain filtering enabled, checking all subdomains too")
|
|
||||||
for _, domain := range domainsToInspect {
|
for _, domain := range domainsToInspect {
|
||||||
subdomains := splitDomain(domain)
|
subdomains := splitDomain(domain)
|
||||||
domains = append(domains, subdomains...)
|
domains = append(domains, subdomains...)
|
||||||
|
@ -381,7 +380,7 @@ func (e *Entity) getASNLists(ctx context.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
asn, ok := e.GetASN(ctx)
|
asn, ok := e.GetASN(ctx)
|
||||||
if !ok {
|
if !ok || asn == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,7 +405,7 @@ func (e *Entity) getCountryLists(ctx context.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
country, ok := e.GetCountry(ctx)
|
country, ok := e.GetCountry(ctx)
|
||||||
if !ok {
|
if !ok || country == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -430,11 +429,7 @@ func (e *Entity) getIPLists(ctx context.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ip, ok := e.GetIP()
|
ip, ok := e.GetIP()
|
||||||
if !ok {
|
if !ok || ip == nil {
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if ip == nil {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue