Skip to content

Commit

Permalink
Soe time ago, we fixed the config validator to accept revServer lines…
Browse files Browse the repository at this point in the history
… without <domain>, however, there was another check at the point where this configuration is written intp dnsmasq.conf as users may have edited pihole.toml directly without going through the API (so, effectively, bypassing the validators). This last check still enforced <domain> which is relaxed herein

Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Feb 21, 2025
1 parent 03cc1d3 commit cb43c6e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/config/dnsmasq_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,9 @@ bool __attribute__((const)) write_dnsmasq_config(struct config *conf, bool test_
continue;
}

if(active == NULL || cidr == NULL || target == NULL || domain == NULL)
if(active == NULL || cidr == NULL || target == NULL)
{
log_err("Skipped invalid dns.revServers[%u]: %s", i, revServer->valuestring);
log_err("Skipped invalid dns.revServers[%u]: %s (not fully defined)", i, revServer->valuestring);
free(copy);
continue;
}
Expand All @@ -513,7 +513,7 @@ bool __attribute__((const)) write_dnsmasq_config(struct config *conf, bool test_

// If we have a reverse domain, we forward all queries to this domain to
// the same destination
if(strlen(domain) > 0)
if(domain != NULL && strlen(domain) > 0)
{
fprintf(pihole_conf, "server=/%s/%s\n", domain, target);

Expand Down

0 comments on commit cb43c6e

Please sign in to comment.