diff options
author | Matt Johnston <matt@ucc.asn.au> | 2008-09-14 06:47:51 +0000 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2008-09-14 06:47:51 +0000 |
commit | 1c72a35ddb79eede31657a450b8ba35aed24c79e (patch) | |
tree | e6f6ae8bac919e2696678d7a680dce410a1ea91a /cli-chansession.c | |
parent | cdbe853595d1ba06be4127d86c60a9bc2e9e3545 (diff) | |
parent | 460bf4382257a262fda862f66d6fe97c749f5bb7 (diff) |
propagate from branch 'au.asn.ucc.matt.dropbear' (head f21045c791002d81fc6b8dde6537ea481e513eb2)
to branch 'au.asn.ucc.matt.dropbear.dbclient-netcat-alike' (head d1f69334581dc4c35f9ca16aa5355074c9dd315d)
--HG--
branch : dbclient-netcat-alike
extra : convert_revision : 22bbe895accc3995b48f07b556e45d546ff1ce5d
Diffstat (limited to 'cli-chansession.c')
-rw-r--r-- | cli-chansession.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/cli-chansession.c b/cli-chansession.c index 76dbb3c..beb065c 100644 --- a/cli-chansession.c +++ b/cli-chansession.c @@ -64,16 +64,17 @@ static void cli_chansessreq(struct Channel *channel) { type = buf_getstring(ses.payload, NULL); wantreply = buf_getbool(ses.payload); - if (strcmp(type, "exit-status") != 0) { + if (strcmp(type, "exit-status") == 0) { + cli_ses.retval = buf_getint(ses.payload); + TRACE(("got exit-status of '%d'", cli_ses.retval)) + } else if (strcmp(type, "exit-signal") == 0) { + TRACE(("got exit-signal, ignoring it")) + } else { TRACE(("unknown request '%s'", type)) send_msg_channel_failure(channel); goto out; } - /* We'll just trust what they tell us */ - cli_ses.retval = buf_getint(ses.payload); - TRACE(("got exit-status of '%d'", cli_ses.retval)) - out: m_free(type); } @@ -162,8 +163,6 @@ void cli_tty_cleanup() { static void put_termcodes() { - TRACE(("enter put_termcodes")) - struct termios tio; unsigned int sshcode; const struct TermCode *termcode; @@ -172,6 +171,8 @@ static void put_termcodes() { unsigned int bufpos1, bufpos2; + TRACE(("enter put_termcodes")) + if (tcgetattr(STDIN_FILENO, &tio) == -1) { dropbear_log(LOG_WARNING, "Failed reading termmodes"); buf_putint(ses.writepayload, 1); /* Just the terminator */ @@ -349,7 +350,7 @@ static int cli_initchansess(struct Channel *channel) { channel->errfd = STDERR_FILENO; setnonblocking(STDERR_FILENO); - channel->extrabuf = cbuf_new(RECV_MAXWINDOW); + channel->extrabuf = cbuf_new(opts.recv_window); if (cli_opts.wantpty) { send_chansess_pty_req(channel); |