From 21be1bd58e6e378ac0f5b8cd4069d78a68e4d836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Thu, 20 Oct 2022 06:53:13 +0200 Subject: [PATCH 1/2] Prevent CNAME loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- advanced/Scripts/webpage.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh index e02e03f9..2dc2d4c5 100755 --- a/advanced/Scripts/webpage.sh +++ b/advanced/Scripts/webpage.sh @@ -729,7 +729,12 @@ AddCustomCNAMERecord() { if [[ -n "${validDomain}" ]]; then validTarget="$(checkDomain "${target}")" if [[ -n "${validTarget}" ]]; then - echo "cname=${validDomain},${validTarget}" >> "${dnscustomcnamefile}" + if [ "${validDomain}" = "${validTarget}" ]; then + echo " ${CROSS} Domain and target are the same!" + exit 1 + else + echo "cname=${validDomain},${validTarget}" >> "${dnscustomcnamefile}" + fi else echo " ${CROSS} Invalid Target Passed!" exit 1 From c8c6533440126a4abf0dc4e2e1f4316e3ceb7d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sat, 29 Oct 2022 15:09:14 +0200 Subject: [PATCH 2/2] Add small explanation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- advanced/Scripts/webpage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh index 2dc2d4c5..aec8917e 100755 --- a/advanced/Scripts/webpage.sh +++ b/advanced/Scripts/webpage.sh @@ -730,7 +730,7 @@ AddCustomCNAMERecord() { validTarget="$(checkDomain "${target}")" if [[ -n "${validTarget}" ]]; then if [ "${validDomain}" = "${validTarget}" ]; then - echo " ${CROSS} Domain and target are the same!" + echo " ${CROSS} Domain and target are the same. This would cause a DNS loop." exit 1 else echo "cname=${validDomain},${validTarget}" >> "${dnscustomcnamefile}"