mirror of
https://github.com/safing/portmaster
synced 2025-09-02 18:49:14 +00:00
Add check for unknown process
This commit is contained in:
parent
39e5c882a3
commit
78d38a194d
1 changed files with 12 additions and 0 deletions
|
@ -176,6 +176,18 @@ func handleRequest(ctx context.Context, w dns.ResponseWriter, query *dns.Msg) er
|
||||||
// get connection
|
// get connection
|
||||||
conn := network.NewConnectionFromDNSRequest(ctx, q.FQDN, remoteAddr.IP, uint16(remoteAddr.Port))
|
conn := network.NewConnectionFromDNSRequest(ctx, q.FQDN, remoteAddr.IP, uint16(remoteAddr.Port))
|
||||||
|
|
||||||
|
if conn.Process() == nil {
|
||||||
|
tracer.Infof("nameserver: failed to find process for request %s, returning NXDOMAIN", conn)
|
||||||
|
returnNXDomain(w, query)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if conn.Process().Profile() == nil {
|
||||||
|
tracer.Infof("nameserver: process %s does not have a profile associated, returning NXDOMAIN", conn.Process())
|
||||||
|
returnNXDomain(w, query)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// save security level to query
|
// save security level to query
|
||||||
q.SecurityLevel = conn.Process().Profile().SecurityLevel()
|
q.SecurityLevel = conn.Process().Profile().SecurityLevel()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue