DnsServer: Updated code to write more specific error log for dynamic updates security policy.

This commit is contained in:
Shreyas Zare
2023-07-02 15:45:11 +05:30
parent 9cf6168aa8
commit aa0a7ef6f6

View File

@@ -1308,7 +1308,11 @@ namespace DnsServerCore.Dns
}
if (!isPermitted)
{
_log?.Write(remoteEP, protocol, "DNS Server refused a zone UPDATE request [" + uRecord.Name.ToLowerInvariant() + " " + uRecord.Type.ToString() + " " + uRecord.Class.ToString() + "] due to Dynamic Updates Security Policy for zone: " + (authZoneInfo.Name == "" ? "<root>" : authZoneInfo.Name));
return false;
}
}
}
@@ -1440,11 +1444,7 @@ namespace DnsServerCore.Dns
//check for permissions
if (!await IsUpdatePermittedAsync())
{
_log?.Write(remoteEP, protocol, "DNS Server refused a zone UPDATE request due to Dynamic Updates Security Policy for zone: " + (authZoneInfo.Name == "" ? "<root>" : authZoneInfo.Name));
return new DnsDatagram(request.Identifier, true, DnsOpcode.Update, false, false, request.RecursionDesired, false, false, false, DnsResponseCode.Refused, request.Question) { Tag = DnsServerResponseType.Authoritative };
}
//process update section
{