Skip to content

Commit 4547bb0

Browse files
authored
Merge pull request hestiacp#2842 from jaapmarcus/fix/2838-block-cname-on-root
Fix hestiacp#2838 Prevent users adding CNAME for @ record
2 parents 0642453 + a671825 commit 4547bb0

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

bin/v-add-dns-record

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ if [ "$rtype" != "CAA" ]; then
7373
fi
7474
fi
7575

76+
if [ "$record" = "@" ] && [ "$rtype" = "CNAME" ]; then
77+
check_result $E_INVALID "CNAME on root is not allowed"
78+
fi
79+
7680
# Additional argument formatting
7781
format_domain
7882
format_domain_idn

bin/v-change-dns-record

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ check_hestia_demo_mode
5858
# Action #
5959
#----------------------------------------------------------#
6060

61+
if [ "$record" = "@" ] && [ "$rtype" = "CNAME" ]; then
62+
check_result $E_INVALID "CNAME on root is not allowed"
63+
fi
64+
6165
# Make sure the variable for the optional parameter TTL is empty before parsing
6266
# We depend on that later on
6367
unset TTL

0 commit comments

Comments
 (0)