Fix bug which would cause pwgen to loop forever if the password length

specified is 1.
This commit is contained in:
tytso 2006-01-16 04:13:12 +00:00
parent 3e36bedfea
commit 7e39a481cf
3 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2006-01-15 Theodore Ts'o <tytso@mit.edu>
* pwgen.c (main): Fix bug which would cause pwgen to loop forever
if the password length specified is 1.
2005-06-15 Theodore Ts'o <tytso@mit.edu>
* pw_phonemes.c (pw_phonemes): Allow one or more capital letters

4
debian/changelog vendored
View File

@ -2,8 +2,10 @@ pwgen (2.04-2) unstable; urgency=low
* Add a udeb for debian-installer. Thanks to Martin Michlmayr for the
patch. (Closes: #271115)
* Fix bug which would cause pwgen to loop forever if the password length
is 1.
-- Theodore Y. Ts'o <tytso@mit.edu> Sun, 15 Jan 2006 22:31:01 -0500
-- Theodore Y. Ts'o <tytso@mit.edu> Sun, 15 Jan 2006 23:11:10 -0500
pwgen (2.04-1) unstable; urgency=low

View File

@ -158,6 +158,10 @@ int main(int argc, char **argv)
pw_length = strtol(argv[optind], &tmp, 0);
if (pw_length < 5)
pwgen = pw_rand;
if (pw_length <= 2)
pwgen_flags &= ~PW_UPPERS;
if (pw_length <= 1)
pwgen_flags &= ~PW_DIGITS;
if (*tmp) {
fprintf(stderr, "Invalid password length: %s\n",
argv[optind]);