Skip to content

Commit 654838b

Browse files
authored
More informative error for long MySQL username
We talked about it at outroll/vesta#860 issue
1 parent 785d5dd commit 654838b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

func/main.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,10 @@ is_date_format_valid() {
583583
# Database user validator
584584
is_dbuser_format_valid() {
585585
exclude="[!|@|#|$|^|&|*|(|)|+|=|{|}|:|,|<|>|?|/|\|\"|'|;|%|\`| ]"
586-
if [[ "$1" =~ $exclude ]] || [ 17 -le ${#1} ]; then
586+
if [ 17 -le ${#1} ]; then
587+
check_result $E_INVALID "mysql username can be up to 16 characters long"
588+
fi
589+
if [[ "$1" =~ $exclude ]]; then
587590
check_result $E_INVALID "invalid $2 format :: $1"
588591
fi
589592
}

0 commit comments

Comments
 (0)