Просмотр исходного кода

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

Fix #2838 Prevent users adding CNAME for @ record
Raphael 3 лет назад
Родитель
Сommit
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