Skip to content

Commit d464fbd

Browse files
author
Till Brehm
committed
Merge branch '6875-fix-query-api-dns_zone_get_id' into 'develop'
Improve DNS SOA origin matching: use exact match for origin #6875 Closes #6875 See merge request ispconfig/ispconfig3!2026
2 parents 82d1368 + 78fb639 commit d464fbd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

interface/lib/classes/remote.d/dns.inc.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function dns_zone_get_id($session_id, $origin) {
152152
return false;
153153
}
154154

155-
$rec = $app->db->queryOneRecord("SELECT id FROM dns_soa WHERE origin like ?", $origin."%");
155+
$rec = $app->db->queryOneRecord("SELECT id FROM dns_soa WHERE origin = ? or origin = ?", $origin, $origin.'.');
156156
if(isset($rec['id'])) {
157157
return $app->functions->intval($rec['id']);
158158
} else {
@@ -743,7 +743,7 @@ public function dns_zone_set_status($session_id, $primary_id, $status) {
743743
return false;
744744
}
745745
}
746-
746+
747747
/*
748748
* Set DNSSec Algo and activate it if needed.
749749
*
@@ -754,14 +754,14 @@ public function dns_zone_set_status($session_id, $primary_id, $status) {
754754
*
755755
* @author Tom Albers <kovoks@kovoks.nl> KovoKs B.V. 2023
756756
*/
757-
757+
758758
public function dns_zone_set_dnssec($session_id, $client_id, $primary_id, $algo, $update_serial=false) {
759759
global $app;
760760
if(!$this->checkPerm($session_id, 'dns_zone_set_status')) {
761761
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
762762
return false;
763763
}
764-
764+
765765
if(!in_array($algo, ['NSEC3RSASHA1', 'ECDSAP256SHA256', 'NSEC3RSASHA1,ECDSAP256SHA256'])) {
766766
throw new SoapFault('permission_denied', 'You are not using a valid algorithm for this function.');
767767
return false;

0 commit comments

Comments
 (0)