]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Fix spurious EAGAIN in Plink host key (and other) prompts.
authorSimon Tatham <anakin@pobox.com>
Thu, 24 Sep 2015 10:58:44 +0000 (11:58 +0100)
committerSimon Tatham <anakin@pobox.com>
Thu, 24 Sep 2015 10:58:44 +0000 (11:58 +0100)
commitbea758a7ae0507e0d4a24b370f8401661cc1a2c8
treeb53f040b6c0cd6cb43e49871f075303c7d63b6fd
parent5f6e443b55d9d2c53b0aadc857181ec377c95e18
Fix spurious EAGAIN in Plink host key (and other) prompts.

Plink sets standard input into nonblocking mode, meaning that read()
from fd 0 in an interactive context will typically return -1 EAGAIN.
But the prompt functions in uxcons.c, used for verifying SSH host keys
and suchlike, were doing an unguarded read() from fd 0, and then
panicking and aborting the session when they got EAGAIN.

Fixed by inventing a wrapper around read(2) which handles EAGAIN but
passes all other errors back to the caller. (Seemed slightly less
dangerous than the stateful alternative of temporarily re-blockifying
the file descriptor.)
unix/uxcons.c