Skip to content

Commit d66f301

Browse files
committed
fixed wildcards bug and dns restart issue
1 parent 805bc37 commit d66f301

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

bin/v_add_dns_domain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ increase_user_value "$user" '$U_DNS_DOMAINS'
116116
increase_user_value "$user" '$U_DNS_RECORDS' "$records"
117117

118118
# Restart named
119-
$BIN/v_restart_web "$EVENT"
119+
$BIN/v_restart_dns "$EVENT"
120120

121121
# Logging
122122
log_history "$EVENT"

func/main.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,16 @@ validate_format_domain() {
562562
fi
563563
}
564564

565+
# Domain alias
566+
validate_format_domain_alias() {
567+
exclude="[!|@|#|$|^|&|(|)|+|=|{|}|:|,|<|>|?|_|/|\|\"|'|;|%|\`| ]"
568+
if [[ "$1" =~ $exclude ]] || [[ "$1" =~ "^[0-9]+$" ]]; then
569+
echo "Error: domain alias $1 is not valid"
570+
log_event "$E_INVALID" "$EVENT"
571+
exit $E_INVALID
572+
fi
573+
}
574+
565575
# Database
566576
validate_format_database() {
567577
exclude="[!|@|#|$|^|&|*|(|)|+|=|{|}|:|,|.|<|>|?|/|\|\"|'|;|%|\`| ]"
@@ -698,7 +708,7 @@ validate_format(){
698708
dkim) validate_format_boolean "$arg" 'dkim' ;;
699709
dkim_size) validate_format_key_size "$arg" ;;
700710
domain) validate_format_domain "$arg" ;;
701-
dom_alias) validate_format_domain "$arg" ;;
711+
dom_alias) validate_format_domain_alias "$arg" ;;
702712
dvalue) validate_format_dvalue "$arg";;
703713
email) validate_format_email "$arg" ;;
704714
exp) validate_format_date "$arg" ;;

0 commit comments

Comments
 (0)