You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by sm...@apache.org on 2025/03/19 14:38:04 UTC

(trafficcontrol) 03/05: Patch: Adding root record to TR Delivery Service

This is an automated email from the ASF dual-hosted git repository.

smalenfant pushed a commit to branch sm/tomcat-CVE-2025-24813
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit b84e22484d2f2cb074b7435afa56d3470aa991a5
Author: Steve Malenfant <sm...@apache.org>
AuthorDate: Wed Feb 26 16:56:29 2025 +0000

    Patch: Adding root record to TR Delivery Service
---
 traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go     | 2 +-
 .../apache/traffic_control/traffic_router/core/dns/ZoneManager.java | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go b/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go
index cfc768fda7..99464b9faf 100644
--- a/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go
+++ b/traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go
@@ -134,7 +134,7 @@ func (staticDNSEntry TOStaticDNSEntry) Validate() (error, error) {
 	}
 
 	errs := validation.Errors{
-		"host":              validation.Validate(staticDNSEntry.Host, validation.Required, is.DNSName),
+                "host": validation.Validate(staticDNSEntry.Host, validation.Required, validation.Match(regexp.MustCompile(`^([a-zA-Z0-9_@*]{1}[a-zA-Z0-9_-]{0,62}){1}(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*[\._]?$`))),
 		"address":           addressErr,
 		"deliveryserviceId": validation.Validate(staticDNSEntry.DeliveryServiceID, validation.Required),
 		"ttl":               ttlErr,
diff --git a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java
index 17cda2e957..a76eb36122 100644
--- a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java
+++ b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java
@@ -775,7 +775,11 @@ public class ZoneManager extends Resolver {
 	}
 
 	private static Name newName(final String hostname, final String domain) throws TextParseException {
-		return newName(hostname + "." + domain);
+		if ("@".equals(hostname)) {
+			return newName(domain);
+		} else {
+			return newName(hostname + "." + domain);
+		}
 	}
 
 	private static Name newName(final String fqdn) throws TextParseException {