Bug 150537 - passwd prompts before it is ready to read
passwd prompts before it is ready to read
Product: Fedora
Classification: Fedora
Component: pam (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tomas Mraz
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2005-03-07 20:59 EST by Jens Petersen
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: pam-0.79-4
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-04-08 11:17:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jens Petersen 2005-03-07 20:59:15 EST
Description of problem:
Quoting from the expect FAQ:

"Why does Expect sometimes misbehave when automating passwd on RedHat
(and derived Linux systems)

This is a two-part question.

   1. Expect sometimes hangs.

      RedHat passwd has a bug. It prompts before it is ready to
receive input. Humans are slow (relatively speaking) so this normally
isn't noticeable. Alas, Expect is fast enough that by the time passwd
is ready, Expect has already sent the password. So passwd sits and
waits and Expect sits and waits. It appears hung.

      A simple workaround: Briefly pause before sending the password.
A tenth of a second is probably sufficient but of course since the
passwd program makes no guarantees, I can't either.
   2. Expect sometimes seems really slow.

      This is really the same bug as above, except that you haven't
explicitly specified a timeout. Expect uses its default of 10 seconds,
meaning that it stops waiting after 10 seconds and resends the
password (presuming you are looping to send the password as long as
/bin/passwd keeps asking). After 10 seconds, /bin/passwd is highly
likely to finally be listening. So /bin/passwd tells Expect it is now
happy and Expect finishes.

The underlying routine containing the bug is traditionally a C
function called getpass. Since it is shared by most other programs
that prompt for passwords (rlogin, su, etc), you are likely to find
this same misbehavior in other programs. I've just used password here
because its the one asked about most frequently.

Could someone get RedHat to fix this bug?"
Comment 2 Jindrich Novy 2005-03-24 11:17:54 EST

We decided that Tomas will take the maintenance of passwd because I'm busy with
other items now and he also maintains PAM so please sync with Tomas to have this
issue fixed. I'll be here in Cc to comment things out when needed.

Comment 3 Tomas Mraz 2005-03-24 12:58:21 EST
This one is nice. I'm almost sure that it comes from the default PAM
conversation routine where the input buffer is flushed just after the prompt
appears, however I'm really not sure how to fix this problem as I don't want to
introduce any regressions in this pretty critical routine.
Comment 4 Tomas Mraz 2005-04-08 11:17:53 EDT
It should be fixed now.

Note You need to log in before you can comment on or make changes to this bug.