diff options
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 37 |
1 files changed, 10 insertions, 27 deletions
@@ -33,7 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include "includes.h" | 35 | #include "includes.h" |
36 | RCSID("$OpenBSD: session.c,v 1.122 2002/01/29 22:46:41 markus Exp $"); | 36 | RCSID("$OpenBSD: session.c,v 1.123 2002/02/03 17:53:25 markus Exp $"); |
37 | 37 | ||
38 | #include "ssh.h" | 38 | #include "ssh.h" |
39 | #include "ssh1.h" | 39 | #include "ssh1.h" |
@@ -1729,28 +1729,18 @@ session_auth_agent_req(Session *s) | |||
1729 | } | 1729 | } |
1730 | } | 1730 | } |
1731 | 1731 | ||
1732 | void | 1732 | int |
1733 | session_input_channel_req(int id, void *arg) | 1733 | session_input_channel_req(Channel *c, const char *rtype) |
1734 | { | 1734 | { |
1735 | u_int len; | ||
1736 | int reply; | ||
1737 | int success = 0; | 1735 | int success = 0; |
1738 | char *rtype; | ||
1739 | Session *s; | 1736 | Session *s; |
1740 | Channel *c; | ||
1741 | |||
1742 | rtype = packet_get_string(&len); | ||
1743 | reply = packet_get_char(); | ||
1744 | |||
1745 | s = session_by_channel(id); | ||
1746 | if (s == NULL) | ||
1747 | fatal("session_input_channel_req: channel %d: no session", id); | ||
1748 | c = channel_lookup(id); | ||
1749 | if (c == NULL) | ||
1750 | fatal("session_input_channel_req: channel %d: bad channel", id); | ||
1751 | 1737 | ||
1752 | debug("session_input_channel_req: session %d channel %d request %s reply %d", | 1738 | if ((s = session_by_channel(c->self)) == NULL) { |
1753 | s->self, id, rtype, reply); | 1739 | log("session_input_channel_req: no session %d req %.100s", |
1740 | c->self, rtype); | ||
1741 | return 0; | ||
1742 | } | ||
1743 | debug("session_input_channel_req: session %d req %s", s->self, rtype); | ||
1754 | 1744 | ||
1755 | /* | 1745 | /* |
1756 | * a session is in LARVAL state until a shell, a command | 1746 | * a session is in LARVAL state until a shell, a command |
@@ -1774,14 +1764,7 @@ session_input_channel_req(int id, void *arg) | |||
1774 | if (strcmp(rtype, "window-change") == 0) { | 1764 | if (strcmp(rtype, "window-change") == 0) { |
1775 | success = session_window_change_req(s); | 1765 | success = session_window_change_req(s); |
1776 | } | 1766 | } |
1777 | 1767 | return success; | |
1778 | if (reply) { | ||
1779 | packet_start(success ? | ||
1780 | SSH2_MSG_CHANNEL_SUCCESS : SSH2_MSG_CHANNEL_FAILURE); | ||
1781 | packet_put_int(c->remote_id); | ||
1782 | packet_send(); | ||
1783 | } | ||
1784 | xfree(rtype); | ||
1785 | } | 1768 | } |
1786 | 1769 | ||
1787 | void | 1770 | void |