1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +00:00

Pass SshServerConfig through to sesschan.c.

This will let me change the behaviour of the main session channel
based on command-line tweaks.
This commit is contained in:
Simon Tatham 2019-03-30 07:27:26 +00:00
parent ea32967044
commit 75fccc5d58
4 changed files with 9 additions and 4 deletions

View File

@ -43,6 +43,7 @@ typedef struct sesschan {
bufchain subsys_input; bufchain subsys_input;
SftpServer *sftpsrv; SftpServer *sftpsrv;
ScpServer *scpsrv; ScpServer *scpsrv;
const SshServerConfig *ssc;
Channel chan; Channel chan;
} sesschan; } sesschan;
@ -198,7 +199,8 @@ static const SeatVtable sesschan_seat_vt = {
}; };
Channel *sesschan_new(SshChannel *c, LogContext *logctx, Channel *sesschan_new(SshChannel *c, LogContext *logctx,
const SftpServerVtable *sftpserver_vt) const SftpServerVtable *sftpserver_vt,
const SshServerConfig *ssc)
{ {
sesschan *sess = snew(sesschan); sesschan *sess = snew(sesschan);
memset(sess, 0, sizeof(sesschan)); memset(sess, 0, sizeof(sesschan));
@ -207,6 +209,7 @@ Channel *sesschan_new(SshChannel *c, LogContext *logctx,
sess->chan.vt = &sesschan_channelvt; sess->chan.vt = &sesschan_channelvt;
sess->chan.initial_fixed_window_size = 0; sess->chan.initial_fixed_window_size = 0;
sess->parent_logctx = logctx; sess->parent_logctx = logctx;
sess->ssc = ssc;
/* Start with a completely default Conf */ /* Start with a completely default Conf */
sess->conf = conf_new(); sess->conf = conf_new();

View File

@ -59,7 +59,8 @@ void ssh1_connection_direction_specific_setup(
if (!s->mainchan_chan) { if (!s->mainchan_chan) {
s->mainchan_sc.vt = &ssh1sesschan_vtable; s->mainchan_sc.vt = &ssh1sesschan_vtable;
s->mainchan_sc.cl = &s->cl; s->mainchan_sc.cl = &s->cl;
s->mainchan_chan = sesschan_new(&s->mainchan_sc, s->ppl.logctx, NULL); s->mainchan_chan = sesschan_new(
&s->mainchan_sc, s->ppl.logctx, NULL, s->ssc);
} }
} }

View File

@ -30,7 +30,7 @@ static ChanopenResult chan_open_session(
ppl_logevent("Opened session channel"); ppl_logevent("Opened session channel");
CHANOPEN_RETURN_SUCCESS(sesschan_new(sc, s->ppl.logctx, CHANOPEN_RETURN_SUCCESS(sesschan_new(sc, s->ppl.logctx,
s->sftpserver_vt)); s->sftpserver_vt, s->ssc));
} }
static ChanopenResult chan_open_direct_tcpip( static ChanopenResult chan_open_direct_tcpip(

View File

@ -88,7 +88,8 @@ PacketProtocolLayer *ssh1_login_server_new(
AuthPolicy *authpolicy, const SshServerConfig *ssc); AuthPolicy *authpolicy, const SshServerConfig *ssc);
Channel *sesschan_new(SshChannel *c, LogContext *logctx, Channel *sesschan_new(SshChannel *c, LogContext *logctx,
const SftpServerVtable *sftpserver_vt); const SftpServerVtable *sftpserver_vt,
const SshServerConfig *ssc);
Backend *pty_backend_create( Backend *pty_backend_create(
Seat *seat, LogContext *logctx, Conf *conf, char **argv, const char *cmd, Seat *seat, LogContext *logctx, Conf *conf, char **argv, const char *cmd,