comparison channel.h @ 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 3f0ac6bc58a1
children 90ac15aeac43
comparison
equal deleted inserted replaced
1828:3f0ac6bc58a1 1829:a7cc3332d8ab
58 void* typedata; /* a pointer to type specific data */ 58 void* typedata; /* a pointer to type specific data */
59 int writefd; /* read from wire, written to insecure side */ 59 int writefd; /* read from wire, written to insecure side */
60 int readfd; /* read from insecure side, written to wire */ 60 int readfd; /* read from insecure side, written to wire */
61 int errfd; /* used like writefd or readfd, depending if it's client or server. 61 int errfd; /* used like writefd or readfd, depending if it's client or server.
62 Doesn't exactly belong here, but is cleaner here */ 62 Doesn't exactly belong here, but is cleaner here */
63 int bidir_fd; /* a boolean indicating that writefd/readfd are the same
64 file descriptor (bidirectional), such as a network socket or PTY.
65 That is handled differently when closing FDs */
63 circbuffer *writebuf; /* data from the wire, for local consumption. Can be 66 circbuffer *writebuf; /* data from the wire, for local consumption. Can be
64 initially NULL */ 67 initially NULL */
65 circbuffer *extrabuf; /* extended-data for the program - used like writebuf 68 circbuffer *extrabuf; /* extended-data for the program - used like writebuf
66 but for stderr */ 69 but for stderr */
67 70
85 enum dropbear_channel_prio prio; 88 enum dropbear_channel_prio prio;
86 }; 89 };
87 90
88 struct ChanType { 91 struct ChanType {
89 92
90 int sepfds; /* Whether this channel has separate pipes for in/out or not */
91 const char *name; 93 const char *name;
92 /* Sets up the channel */ 94 /* Sets up the channel */
93 int (*inithandler)(struct Channel*); 95 int (*inithandler)(struct Channel*);
94 /* Called to check whether a channel should close, separately from the FD being closed. 96 /* Called to check whether a channel should close, separately from the FD being closed.
95 Used for noticing process exiting */ 97 Used for noticing process exiting */