From 74c3bc2578fe8ea9bc5428adb0e5099d421f4495 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 18 Jan 2015 15:39:06 +0000 Subject: [PATCH] Enforce minimum password quality --- src/freedombone | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/freedombone b/src/freedombone index 69841c6c..c3b27aee 100755 --- a/src/freedombone +++ b/src/freedombone @@ -418,12 +418,12 @@ function interactive_configuration_remote_backups { $remote_ssh_port != "" && \ $remote_ssh_password != "" ]]; then - if [ ${#remote_ssh_password} -lt $MINIMUM_PASSWORD_LENGTH ]; then - dialog --title "Password quality check" --msgbox "The password given was too short. It must be at least $MINIMUM_PASSWORD_LENGTH characters" 6 40 - else - echo "$remote_ssh_username@$remote_ssh_domain:$remote_ssh_port//home/$remote_ssh_username $remote_ssh_password" >> $FRIENDS_SERVERS_LIST - entering_remote_backups_ctr=$((entering_remote_backups_ctr + 1)) - fi + if [ ${#remote_ssh_password} -lt $MINIMUM_PASSWORD_LENGTH ]; then + dialog --title "Password quality check" --msgbox "The password given was too short. It must be at least $MINIMUM_PASSWORD_LENGTH characters" 6 40 + else + echo "$remote_ssh_username@$remote_ssh_domain:$remote_ssh_port//home/$remote_ssh_username $remote_ssh_password" >> $FRIENDS_SERVERS_LIST + entering_remote_backups_ctr=$((entering_remote_backups_ctr + 1)) + fi else entering_remote_backups_done="yes" fi @@ -617,6 +617,10 @@ function interactive_configuration { 1) exit 0;; 255) exit 0;; esac + if [ ${#DDNS_PASSWORD} -lt $MINIMUM_PASSWORD_LENGTH ]; then + dialog --title "Password quality check" --msgbox "The password given was too short. It must be at least $MINIMUM_PASSWORD_LENGTH characters" 6 40 + DDNS_PASSWORD="" + fi done while [ ! $MY_NAME ]