Skip to content

Commit 2886d68

Browse files
committed
feat: add password length limit
1 parent 76967a4 commit 2886d68

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

installer.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,13 +423,16 @@ if [ "$CHANGEPASSWORD" = "y" ]; then
423423
valid_pass=false
424424
while [ "$valid_pass" = false ] ;
425425
do
426-
echo -n -e "Password requirements: min 8 characters, at least 1 lower case letter, at least 1 upper case letter, at least 1 number, at least 1 special character !@#$%^&*()_+$ \nSet the password to access the Dashboard:"
426+
echo -n -e "Password requirements: min 8 characters, max 128 characters, at least 1 lower case letter, at least 1 upper case letter, at least 1 number, at least 1 special character !@#$%^&*()_+$ \nSet the password to access the Dashboard:"
427427
DASHPASS=$(read_password)
428428

429429
# Check password length
430430
if (( ${#DASHPASS} < 8 )); then
431431
echo -e "\nInvalid password! Too short.\n"
432432

433+
if (( ${#DASHPASS} > 128 )); then
434+
echo -e "\nInvalid password! Too long.\n"
435+
433436
# Check for at least one lowercase letter
434437
elif ! [[ "$DASHPASS" =~ [a-z] ]]; then
435438
echo -e "\nInvalid password! Must contain at least one lowercase letter.\n"

0 commit comments

Comments
 (0)