소스 검색

Merge pull request #2842 from jaapmarcus/fix/2838-block-cname-on-root

Fix #2838 Prevent users adding CNAME for @ record
Raphael 3 년 전
부모
커밋
4547bb0e29
2개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      bin/v-add-dns-record
  2. 4 0
      bin/v-change-dns-record

+ 4 - 0
bin/v-add-dns-record

@@ -73,6 +73,10 @@ if [ "$rtype" != "CAA" ]; then
     fi
 fi
 
+if [ "$record" = "@" ] && [ "$rtype" = "CNAME" ]; then
+    check_result $E_INVALID "CNAME on root is not allowed"
+fi
+
 # Additional argument formatting
 format_domain
 format_domain_idn

+ 4 - 0
bin/v-change-dns-record

@@ -58,6 +58,10 @@ check_hestia_demo_mode
 #                       Action                             #
 #----------------------------------------------------------#
 
+if [ "$record" = "@" ] && [ "$rtype" = "CNAME" ]; then
+    check_result $E_INVALID "CNAME on root is not allowed"
+fi
+
 # Make sure the variable for the optional parameter TTL is empty before parsing
 # We depend on that later on
 unset TTL