Only return regex index when allowed by privacy settings. This may leak information, otherwise.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2021-01-08 19:22:38 +01:00
parent 5989cf9216
commit ee971091b4
+3 -2
View File
@@ -993,9 +993,10 @@ void getAllQueries(const char *client_message, const int *sock)
CNAME_domain = getCNAMEDomainString(query);
}
// Get ID of blocking regex, if applicable
// Get ID of blocking regex, if applicable and permitted by privacy settings
int regex_idx = -1;
if (query->status == QUERY_REGEX || query->status == QUERY_REGEX_CNAME)
if ((query->status == QUERY_REGEX || query->status == QUERY_REGEX_CNAME) &&
config.privacylevel < PRIVACY_HIDE_DOMAINS)
{
unsigned int cacheID = findCacheID(query->domainID, query->clientID, query->type);
DNSCacheData *dns_cache = getDNSCache(cacheID, true);