瀏覽代碼

Password length for remote backups

Bob Mottram 10 年之前
父節點
當前提交
344c87b2f2
共有 1 個檔案被更改,包括 10 行新增2 行删除
  1. 10
    2
      src/freedombone

+ 10
- 2
src/freedombone 查看文件

116
 CURRENT_DDNS_DOMAIN=
116
 CURRENT_DDNS_DOMAIN=
117
 CURRENT_DDNS_CODE=
117
 CURRENT_DDNS_CODE=
118
 
118
 
119
+# Minimum number of characters in a password
120
+MINIMUM_PASSWORD_LENGTH=10
121
+
119
 # number of CPU cores
122
 # number of CPU cores
120
 CPU_CORES=1
123
 CPU_CORES=1
121
 
124
 
414
           $remote_ssh_domain != "" && \
417
           $remote_ssh_domain != "" && \
415
           $remote_ssh_port != "" && \
418
           $remote_ssh_port != "" && \
416
           $remote_ssh_password != "" ]]; then
419
           $remote_ssh_password != "" ]]; then
417
-          echo "$remote_ssh_username@$remote_ssh_domain:$remote_ssh_port//home/$remote_ssh_username $remote_ssh_password" >> $FRIENDS_SERVERS_LIST
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
418
       else
427
       else
419
           entering_remote_backups_done="yes"
428
           entering_remote_backups_done="yes"
420
       fi
429
       fi
421
-      entering_remote_backups_ctr=$((entering_remote_backups_ctr + 1))
422
   done
430
   done
423
   if [ -f $FRIENDS_SERVERS_LIST ]; then
431
   if [ -f $FRIENDS_SERVERS_LIST ]; then
424
       chown $MY_USERNAME:$MY_USERNAME $FRIENDS_SERVERS_LIST
432
       chown $MY_USERNAME:$MY_USERNAME $FRIENDS_SERVERS_LIST