Browse Source

Enforce minimum password quality

Bob Mottram 10 years ago
parent
commit
74c3bc2578
1 changed files with 10 additions and 6 deletions
  1. 10
    6
      src/freedombone

+ 10
- 6
src/freedombone View File

418
           $remote_ssh_port != "" && \
418
           $remote_ssh_port != "" && \
419
           $remote_ssh_password != "" ]]; then
419
           $remote_ssh_password != "" ]]; then
420
 
420
 
421
-		  if [ ${#remote_ssh_password} -lt $MINIMUM_PASSWORD_LENGTH ]; then
422
-			  dialog --title "Password quality check" --msgbox "The password given was too short. It must be at least $MINIMUM_PASSWORD_LENGTH characters" 6 40
423
-		  else
424
-			  echo "$remote_ssh_username@$remote_ssh_domain:$remote_ssh_port//home/$remote_ssh_username $remote_ssh_password" >> $FRIENDS_SERVERS_LIST
425
-			  entering_remote_backups_ctr=$((entering_remote_backups_ctr + 1))
426
-		  fi
421
+          if [ ${#remote_ssh_password} -lt $MINIMUM_PASSWORD_LENGTH ]; then
422
+              dialog --title "Password quality check" --msgbox "The password given was too short. It must be at least $MINIMUM_PASSWORD_LENGTH characters" 6 40
423
+          else
424
+              echo "$remote_ssh_username@$remote_ssh_domain:$remote_ssh_port//home/$remote_ssh_username $remote_ssh_password" >> $FRIENDS_SERVERS_LIST
425
+              entering_remote_backups_ctr=$((entering_remote_backups_ctr + 1))
426
+          fi
427
       else
427
       else
428
           entering_remote_backups_done="yes"
428
           entering_remote_backups_done="yes"
429
       fi
429
       fi
617
           1) exit 0;;
617
           1) exit 0;;
618
           255) exit 0;;
618
           255) exit 0;;
619
       esac
619
       esac
620
+      if [ ${#DDNS_PASSWORD} -lt $MINIMUM_PASSWORD_LENGTH ]; then
621
+          dialog --title "Password quality check" --msgbox "The password given was too short. It must be at least $MINIMUM_PASSWORD_LENGTH characters" 6 40
622
+          DDNS_PASSWORD=""
623
+      fi
620
   done
624
   done
621
 
625
 
622
   while [ ! $MY_NAME ]
626
   while [ ! $MY_NAME ]