mirror of
https://github.com/myvesta/vesta
synced 2025-07-10 15:23:15 -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
|
# Database user validator
|
||||||
is_dbuser_format_valid() {
|
is_dbuser_format_valid() {
|
||||||
exclude="[!|@|#|$|^|&|*|(|)|+|=|{|}|:|,|<|>|?|/|\|\"|'|;|%|\`| ]"
|
exclude="[!|@|#|$|^|&|*|(|)|+|=|{|}|:|,|<|>|?|/|\|\"|'|;|%|\`| ]"
|
||||||
if [ 17 -le ${#1} ]; then
|
my_max_dbuser_len=16
|
||||||
check_result $E_INVALID "mysql username can be up to 16 characters long"
|
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
|
fi
|
||||||
if [[ "$1" =~ $exclude ]]; then
|
if [[ "$1" =~ $exclude ]]; then
|
||||||
check_result $E_INVALID "invalid $2 format :: $1"
|
check_result $E_INVALID "invalid $2 format :: $1"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue