summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2000-10-27 07:32:17 +0000
committermarkus <markus@openbsd.org>2000-10-27 07:32:17 +0000
commitb412a424f6822a01f28419e642001acd2d3cb77d (patch)
treefb2ceddd74bd7c7b2baa735c03c42bdee02c3fca /usr.bin/ssh/ssh.c
parentafter seeding from the host.random file, immediately reset the seed file, so (diff)
downloadwireguard-openbsd-b412a424f6822a01f28419e642001acd2d3cb77d.tar.xz
wireguard-openbsd-b412a424f6822a01f28419e642001acd2d3cb77d.zip
enable non-blocking IO on channels, and tty's (except for the client ttys).
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r--usr.bin/ssh/ssh.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index a915b57cd2a..f6717262611 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/ssh.c
@@ -39,7 +39,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh.c,v 1.68 2000/10/11 20:27:24 markus Exp $");
+RCSID("$OpenBSD: ssh.c,v 1.69 2000/10/27 07:32:19 markus Exp $");
#include <openssl/evp.h>
#include <openssl/dsa.h>
@@ -980,6 +980,14 @@ ssh_session2(void)
if (in < 0 || out < 0 || err < 0)
fatal("dup() in/out/err failed");
+ /* enable nonblocking unless tty */
+ if (!isatty(in))
+ set_nonblock(in);
+ if (!isatty(out))
+ set_nonblock(out);
+ if (!isatty(err))
+ set_nonblock(err);
+
/* should be pre-session */
init_local_fwd();
@@ -997,7 +1005,7 @@ ssh_session2(void)
id = channel_new(
"session", SSH_CHANNEL_OPENING, in, out, err,
window, packetmax, CHAN_EXTENDED_WRITE,
- xstrdup("client-session"));
+ xstrdup("client-session"), /*nonblock*/0);
channel_open(id);
channel_register_callback(id, SSH2_MSG_CHANNEL_OPEN_CONFIRMATION, client_init, (void *)0);