Skip to content

Commit 0994d48

Browse files
committed
aligned limit with mysql database name lengh
1 parent 5154786 commit 0994d48

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

func/main.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,16 @@ validate_format_domain_alias() {
620620
}
621621

622622
# Database
623+
validate_format_database() {
624+
exclude="[!|@|#|$|^|&|*|(|)|+|=|{|}|:|,|.|<|>|?|/|\|\"|'|;|%|\`| ]"
625+
if [[ "$1" =~ $exclude ]] || [ 65 -le ${#1} ]; then
626+
echo "Error: $2 $1 is not valid"
627+
log_event "$E_INVALID" "$EVENT"
628+
exit $E_INVALID
629+
fi
630+
}
631+
632+
# Database user
623633
validate_format_database() {
624634
exclude="[!|@|#|$|^|&|*|(|)|+|=|{|}|:|,|.|<|>|?|/|\|\"|'|;|%|\`| ]"
625635
if [[ "$1" =~ $exclude ]] || [ 17 -le ${#1} ]; then
@@ -761,7 +771,7 @@ validate_format(){
761771
database) validate_format_database "$arg" 'database';;
762772
day) validate_format_mhdmw "$arg" $arg_name ;;
763773
dbpass) validate_format_password "$arg" ;;
764-
dbuser) validate_format_database "$arg" 'db_user';;
774+
dbuser) validate_format_duser "$arg" 'db_user';;
765775
dkim) validate_format_boolean "$arg" 'dkim' ;;
766776
dkim_size) validate_format_key_size "$arg" ;;
767777
domain) validate_format_domain "$arg" 'domain';;

0 commit comments

Comments
 (0)