Bug 150537 - passwd prompts before it is ready to read
Summary: passwd prompts before it is ready to read
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: pam
Version: 3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tomas Mraz
QA Contact: Mike McLean
URL: http://expect.nist.gov/FAQ.html#q73
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-03-08 01:59 UTC by Jens Petersen
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version: pam-0.79-4
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-04-08 15:17:53 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jens Petersen 2005-03-08 01:59:15 UTC
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 16:17:54 UTC
Jens,

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.

Jindrich

Comment 3 Tomas Mraz 2005-03-24 17:58:21 UTC
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 15:17:53 UTC
It should be fixed now.



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