浏览代码

Enable or disable password storage

Bob Mottram 8 年前
父节点
当前提交
1b0820bf46
共有 2 个文件被更改,包括 22 次插入10 次删除
  1. 7
    0
      src/freedombone-pass
  2. 15
    10
      src/freedombone-sec

+ 7
- 0
src/freedombone-pass 查看文件

160
         -c|--clear|--erase)
160
         -c|--clear|--erase)
161
             clear_passwords
161
             clear_passwords
162
             ;;
162
             ;;
163
+        -e|--enable)
164
+            shift
165
+            if [ -f $NO_PASSWORD_STORE_FILE ]; then
166
+                rm $NO_PASSWORD_STORE_FILE
167
+                echo $'Password storage has been enabled'
168
+            fi
169
+            ;;
163
         -u|--user|--username)
170
         -u|--user|--username)
164
             shift
171
             shift
165
             CURR_USERNAME="${1}"
172
             CURR_USERNAME="${1}"

+ 15
- 10
src/freedombone-sec 查看文件

685
     esac
685
     esac
686
 }
686
 }
687
 
687
 
688
-function clear_passwords {
689
-    dialog --title $"Clear Passwords" \
688
+function store_passwords {
689
+    dialog --title $"Store Passwords" \
690
            --backtitle $"Freedombone Security Configuration" \
690
            --backtitle $"Freedombone Security Configuration" \
691
-           --defaultno \
692
-           --yesno $"\nThis will remove all user passwords from the system. Are you sure that you want to do this?" 8 60
691
+           --yesno $"\nDo you wish to store passwords on the system? Stored passwords are convenient but carry some additional security risk." 10 60
693
     sel=$?
692
     sel=$?
694
     case $sel in
693
     case $sel in
695
-        1) return;;
694
+        0)
695
+            ${PROJECT_NAME}-pass --enable yes
696
+            return
697
+            ;;
698
+        1)
699
+            ${PROJECT_NAME}-pass --clear yes
700
+            dialog --title $"Passwords were removed and will not be stored" \
701
+                   --msgbox $"\nFor the best security you should now manually change passwords via web interfaces so that there is no possibility of them being recovered from the disk" 9 60
702
+            return
703
+            ;;
696
         255) return;;
704
         255) return;;
697
     esac
705
     esac
698
-    ${PROJECT_NAME}-pass --clear yes
699
-    dialog --title $"Passwords were removed" \
700
-           --msgbox $"\nFor the best security you should now manually change passwords via web interfaces so that there is no possibility of them being recovered from the disk" 9 60
701
 }
706
 }
702
 
707
 
703
 function menu_security_settings {
708
 function menu_security_settings {
707
            --title $"Security Settings" \
712
            --title $"Security Settings" \
708
            --radiolist $"Choose an operation:" 18 76 18 \
713
            --radiolist $"Choose an operation:" 18 76 18 \
709
            1 $"Show ssh host public key" off \
714
            1 $"Show ssh host public key" off \
710
-           2 $"Clear password store" off \
715
+           2 $"Password storage" off \
711
            3 $"Regenerate ssh host keys" off \
716
            3 $"Regenerate ssh host keys" off \
712
            4 $"Regenerate Diffie-Hellman keys" off \
717
            4 $"Regenerate Diffie-Hellman keys" off \
713
            5 $"Update cipersuite" off \
718
            5 $"Update cipersuite" off \
744
             exit 0
749
             exit 0
745
             ;;
750
             ;;
746
         2)
751
         2)
747
-            clear_passwords
752
+            store_passwords
748
             exit 0
753
             exit 0
749
             ;;
754
             ;;
750
         3)
755
         3)