comparison cli-chansession.c @ 1829:a7cc3332d8ab

Replace ChanType.sepfds with Channel.bidir_fd This handles the case where a svrchansess has separate FDs for nopty, but a single FD for pty mode. The use of sepfds was also previously incorrect for X11 and agent forwarding
author Matt Johnston <matt@ucc.asn.au>
date Mon, 11 Oct 2021 15:42:14 +0800
parents 4b01f4826a29
children 1d86a58fb52d
comparison
equal deleted inserted replaced
1828:3f0ac6bc58a1 1829:a7cc3332d8ab
44 static int cli_init_netcat(struct Channel *channel); 44 static int cli_init_netcat(struct Channel *channel);
45 45
46 static void cli_tty_setup(void); 46 static void cli_tty_setup(void);
47 47
48 const struct ChanType clichansess = { 48 const struct ChanType clichansess = {
49 0, /* sepfds */
50 "session", /* name */ 49 "session", /* name */
51 cli_initchansess, /* inithandler */ 50 cli_initchansess, /* inithandler */
52 NULL, /* checkclosehandler */ 51 NULL, /* checkclosehandler */
53 cli_chansessreq, /* reqhandler */ 52 cli_chansessreq, /* reqhandler */
54 cli_closechansess, /* closehandler */ 53 cli_closechansess, /* closehandler */
342 341
343 channel->errfd = STDERR_FILENO; 342 channel->errfd = STDERR_FILENO;
344 setnonblocking(STDERR_FILENO); 343 setnonblocking(STDERR_FILENO);
345 344
346 channel->extrabuf = cbuf_new(opts.recv_window); 345 channel->extrabuf = cbuf_new(opts.recv_window);
346 channel->bidir_fd = 0;
347 return 0; 347 return 0;
348 } 348 }
349 349
350 static int cli_init_netcat(struct Channel *channel) { 350 static int cli_init_netcat(struct Channel *channel) {
351 channel->prio = DROPBEAR_CHANNEL_PRIO_UNKNOWABLE; 351 channel->prio = DROPBEAR_CHANNEL_PRIO_UNKNOWABLE;
381 } 381 }
382 382
383 #if DROPBEAR_CLI_NETCAT 383 #if DROPBEAR_CLI_NETCAT
384 384
385 static const struct ChanType cli_chan_netcat = { 385 static const struct ChanType cli_chan_netcat = {
386 0, /* sepfds */
387 "direct-tcpip", 386 "direct-tcpip",
388 cli_init_netcat, /* inithandler */ 387 cli_init_netcat, /* inithandler */
389 NULL, 388 NULL,
390 NULL, 389 NULL,
391 cli_closechansess, 390 cli_closechansess,