1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 23:08:07 +00:00

Prevent CNAME loop

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König 2022-10-20 06:53:13 +02:00
parent 469a267150
commit 21be1bd58e
No known key found for this signature in database

View File

@ -729,7 +729,12 @@ AddCustomCNAMERecord() {
if [[ -n "${validDomain}" ]]; then if [[ -n "${validDomain}" ]]; then
validTarget="$(checkDomain "${target}")" validTarget="$(checkDomain "${target}")"
if [[ -n "${validTarget}" ]]; then if [[ -n "${validTarget}" ]]; then
if [ "${validDomain}" = "${validTarget}" ]; then
echo " ${CROSS} Domain and target are the same!"
exit 1
else
echo "cname=${validDomain},${validTarget}" >> "${dnscustomcnamefile}" echo "cname=${validDomain},${validTarget}" >> "${dnscustomcnamefile}"
fi
else else
echo " ${CROSS} Invalid Target Passed!" echo " ${CROSS} Invalid Target Passed!"
exit 1 exit 1