Browse Source

Limit password to characters or numbers

This avoids crazy characters which are hard to type
Bob Mottram 8 years ago
parent
commit
a08f0b52d1
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/freedombone-utils-passwords

+ 1
- 1
src/freedombone-utils-passwords View File

@@ -51,7 +51,7 @@ function enforce_good_passwords {
51 51
 }
52 52
 
53 53
 function create_password {
54
-    echo "$(openssl rand -base64 32 | cut -c1-${1})"
54
+    openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c ${1} ; echo ''
55 55
 }
56 56
 
57 57
 # NOTE: deliberately no exit 0