Bug 1462557

Summary: "pwgen -n 1" doesn't work as advertised
Product: [Fedora] Fedora Reporter: Andre Robatino <robatino>
Component: pwgenAssignee: jbowes
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jbowes
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andre Robatino 2017-06-18 21:20:01 UTC
Description of problem:
According to the man page, "pwgen -n 1" should generate 1-digit passwords. Instead, all of them are lower-case letters. I wanted to be able to use this to generate a sequence of random digits (such as a PIN), since pwgen doesn't have a numbers-only option.

Version-Release number of selected component (if applicable):
pwgen-2.07-3.fc24.x86_64

How reproducible:
always

Steps to Reproduce:
1. pwgen -n 1

Actual results:
Collection of 1-character lower-case letter passwords

Expected results:
Collection of 1-digit passwords

Additional info:
The -n option appears to work properly if the password length is greater than 1.

Comment 1 Andre Robatino 2017-06-18 21:27:20 UTC
Same behavior in pwgen-2.07-4.fc26.x86_64 in Rawhide.

Comment 2 Andre Robatino 2017-06-27 08:18:22 UTC
Just reported at https://github.com/jbernard/pwgen/issues/2 (but not sure if that's the right upstream bug tracker).

Comment 3 Andre Robatino 2017-07-09 07:18:57 UTC
The above is the wrong bug tracker. The correct one is apparently https://sourceforge.net/projects/pwgen/ (which is owned by the original developer), but there's apparently no way to file a ticket there. It says "To create a new ticket, you must be authorized by the project admin." but there's no way to even request that.

Comment 4 Jan Kurik 2017-08-15 08:23:36 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Comment 5 Ben Cotton 2018-11-27 18:32:24 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Andre Robatino 2018-11-27 19:45:58 UTC
Looks like it works correctly in F29 and Rawhide now. Don't know when it was fixed. Thanks.

Comment 7 Andre Robatino 2018-11-27 19:53:26 UTC
Disregard my previous comment, it's still broken. Sorry. (The man page seems to contradict itself in that it says that if the standard output is a tty device, then by default the password must include at least one capital letter and at least one number, but this is impossible for 1-char passwords, also it's not when pwgen actually does for longer passwords.)