Do not allow empty WPA passphrase. v0.3.4
authorMichael Prokop <mika@grml.org>
Tue, 18 May 2010 12:24:50 +0000 (14:24 +0200)
committerMichael Prokop <mika@grml.org>
Tue, 18 May 2010 12:24:50 +0000 (14:24 +0200)
debian/changelog
sbin/netcardconfig

index 585b100..2b55645 100644 (file)
@@ -1,3 +1,9 @@
+grml-network (0.3.4) unstable; urgency=low
+
+  * Do not allow empty WPA passphrase. [Closes: issue846]
+
+ -- Michael Prokop <mika@grml.org>  Tue, 18 May 2010 14:24:17 +0200
+
 grml-network (0.3.3) unstable; urgency=low
 
   * Add iptables to Recommends.
 grml-network (0.3.3) unstable; urgency=low
 
   * Add iptables to Recommends.
index 40252b7..0b2d89e 100755 (executable)
@@ -325,7 +325,12 @@ configiface() {
                           }
                   }
                   ' /etc/network/interfaces)
                           }
                   }
                   ' /etc/network/interfaces)
-          $DIALOG --inputbox "$MESSAGEW23 $ESSID" 15 50 "$WPASECRET" 2>"$TMP" || bailout 1
+          while [ -z "$WPASECRET" ] ; do
+            $DIALOG --inputbox "$MESSAGEW23 $ESSID" 15 50 "$WPASECRET" 2>"$TMP" || bailout 1
+            if [ -z "$WPASECRET" ] ; then
+              $DIALOG --msgbox "Sorry, empty password not allowed, please retry." 0 0 || bailout 1
+            fi
+          done
 
           # make sure backslashes inside passphrase are handled correct
           WPASECRET=$(sed -e 's/\\/\\/g' "$TMP") && rm -r "$TMP"
 
           # make sure backslashes inside passphrase are handled correct
           WPASECRET=$(sed -e 's/\\/\\/g' "$TMP") && rm -r "$TMP"