There is invalid behaviour of pwgen when using pipes or command substitution
On Debian Etch:
sshhost:~# pwgen -s 12 1
0tciDnkiztVf
sshhost:~# echo `pwgen -s 12 1`
jlexasijnaet
sshhost:~# pwgen -s 12 1 | cat
fstqthddswnv
sshhost:~# pwgen 12 1
eiNo0eel3aih
sshhost:~# echo `pwgen 12 1`
oongeiheukae
sshhost:~# pwgen 12 1 | cat
ahfesohwawie
On Ubuntu Gutsy (invalid behaviour only when no option passed to program):
testuser@test:~$ pwgen 12 1
ooz4Mieloofo
testuser@test:~$ pwgen 12 1 | cat
iebeicapeiph
testuser@test:~$ pwgen 12 1 | cat
zujisheijaht
testuser@test:~$ echo `pwgen 12 1`
eikaidaikeec
The output is always similar to pwgen executed with the options -A and -0. I'm not sure if this is really a problem of pwgen but other programs work fine that way.
Unfortunately I'm not able to log-in to my account anymore and sourceforge don't care about support. Feel free to contact me: smirta@gmx.net
Logged In: NO
This is obviously not a bug.
In addition, for backwards compatibility reasons, when stdout is not a tty and secure password
generation mode has not been requested, pwgen will generate less secure passwords, as if the
-0A options had been passed to it on the command line. This can be overriden using the -nc
options. In the future, the behavior when stdout is a tty may change, so shell scripts using
pwgen should explicitly specify the -nc or -0A options. The latter is not recommended for
security reasons, since such passwords are far too easy to guess.