summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-02-05 12:21:42 +1100
committerDamien Miller <djm@mindrot.org>2002-02-05 12:21:42 +1100
commitc7ef63dd41aa3880271c5ec5f61dc38e6d74f900 (patch)
tree7026ceb6a544a18fa3c197589a338ba5a4697aa8 /session.c
parent664d6b9a8eb4519f3a7f7658886f5745a943d3ef (diff)
- markus@cvs.openbsd.org 2002/02/03 17:53:25
[auth1.c serverloop.c session.c session.h] don't use channel_input_channel_request and callback use new server_input_channel_req() instead: server_input_channel_req does generic request parsing on server side session_input_channel_req handles just session specific things now ok djm@
Diffstat (limited to 'session.c')
-rw-r--r--session.c37
1 files changed, 10 insertions, 27 deletions
diff --git a/session.c b/session.c
index 2b4bbb66a..c6e527ffd 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
33 */ 33 */
34 34
35#include "includes.h" 35#include "includes.h"
36RCSID("$OpenBSD: session.c,v 1.122 2002/01/29 22:46:41 markus Exp $"); 36RCSID("$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
1732void 1732int
1733session_input_channel_req(int id, void *arg) 1733session_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
1787void 1770void