From 185a356d1306867a4c05662ae2ee194beefb6b3d Mon Sep 17 00:00:00 2001 From: Nicolas Brousse Date: Mon, 10 Aug 2015 19:20:44 +0200 Subject: [PATCH] Fix password generate Retrieve the good chars chain to generate the password --- passgen | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/passgen b/passgen index c9dbab7..de9783e 100755 --- a/passgen +++ b/passgen @@ -22,10 +22,7 @@ error() { # Generate password genpasswd() { - local strings=$2 - [ "$length" == "" ] && length=16 - [ "$strings" == "" ] && strings=A-Za-z0-9_- - LC_CTYPE=C tr -dc ${strings} < /dev/urandom | head -c ${length} | xargs + LC_CTYPE=C tr -dc ${chars} < /dev/urandom | head -c ${length} | xargs } # Default values