mirror of
https://github.com/myvesta/vesta
synced 2025-07-06 04:51:54 -07:00
Allow custom $MAX_DBUSER_LEN
echo "MAX_DBUSER_LEN=80" >> /usr/local/vesta/conf/vesta.conf
This commit is contained in:
parent
80730aafa4
commit
f534560782
1 changed files with 6 additions and 2 deletions
|
@ -650,8 +650,12 @@ is_date_format_valid() {
|
|||
# Database user validator
|
||||
is_dbuser_format_valid() {
|
||||
exclude="[!|@|#|$|^|&|*|(|)|+|=|{|}|:|,|<|>|?|/|\|\"|'|;|%|\`| ]"
|
||||
if [ 17 -le ${#1} ]; then
|
||||
check_result $E_INVALID "mysql username can be up to 16 characters long"
|
||||
my_max_dbuser_len=16
|
||||
if [ ! -z "$MAX_DBUSER_LEN" ]; then
|
||||
my_max_dbuser_len=$MAX_DBUSER_LEN
|
||||
fi
|
||||
if [ ${#1} -ge $my_max_dbuser_len ]; then
|
||||
check_result $E_INVALID "mysql username can be up to $my_max_dbuser_len characters long"
|
||||
fi
|
||||
if [[ "$1" =~ $exclude ]]; then
|
||||
check_result $E_INVALID "invalid $2 format :: $1"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue