From 75816ecd050fa51f0297997924e5bfef6b3246b5 Mon Sep 17 00:00:00 2001 From: clk Date: Wed, 29 Jun 2022 11:42:06 +0200 Subject: [PATCH] Fixed wrong dns validation rfc1034: If a CNAME RR is present at a node, no other data should be present --- interface/web/dns/dns_edit_base.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interface/web/dns/dns_edit_base.php b/interface/web/dns/dns_edit_base.php index 61c08f6576..a4e314381a 100644 --- a/interface/web/dns/dns_edit_base.php +++ b/interface/web/dns/dns_edit_base.php @@ -41,6 +41,10 @@ $app->load('tform_actions'); class dns_page_action extends tform_actions { protected function checkDuplicate() { + global $app; + // If a CNAME RR is present at a node, no other data should be present + $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'CNAME' AND name = ? AND zone = ? and id != ?)", $this->dataRecord["name"], $this->dataRecord["zone"], $this->id); + if($tmp['number'] > 0) return true; return false; } -- GitLab