Re: passwd_expect patch

Jan Schneider <[email protected]>
Newsgroups gmane.comp.horde.sork
Message-ID <[email protected]>
Zitat von Andrew Suffield <[email protected]>:

> The following patch was required for me to get passwd_expect to work
> correctly.
>
> --- passwd_expect	2006-11-09 10:58:53.000000000 +0000
> +++ passwd_expect	2006-11-09 10:59:33.000000000 +0000
> @@ -54,6 +53,8 @@
>
>  # read input from stdin
>
> +fconfigure stdin -blocking 1
> +
>  gets stdin user
>  gets stdin password(old)
>  gets stdin password(new)
> @@ -172,7 +168,8 @@
>  # log in
>  expect {
>    -re $fingerprint_string {sleep .5
> -                           send yes\r}
> +                           send yes\r
> +                           exp_continue}
>    -re $password_string    {sleep .5
>                             send $password(old)\r}
>    timeout                 {puts $err "Could not login to system (no  
> password prompt)\n"
>
> I cannot explain why stdin might be in non-blocking mode, but it was,
> and so sometimes expect would miss the username/password strings. I
> can only put this one down to deep crackfulness on the part of tcl,
> expect, apache, or php, and express my strong desire to never know
> what is going on there. Understanding this can only lead to
> pain. Forcing stdin into blocking mode ensures that it always works.
>
> The exp_continue is necessary because otherwise, if expect sees
> $fingerprint_string, it does not bother looking for $password_string
> or sending the old password. Obviously nobody ever tested this, it
> can't ever have worked.
> --
> Sork mailing list - Join the hunt: http://horde.org/bounties/#sork
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: [email protected]
>
>


Please create a ticket on http://bugs.horde.org/.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/

-- 
Sork mailing list - Join the hunt: http://horde.org/bounties/#sork
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.