Skip to content
Snippets Groups Projects
Commit 0f707bad authored by Matt Johnston's avatar Matt Johnston
Browse files

propagate from branch 'au.asn.ucc.matt.dropbear' (head b1dd3b94e60a07a176dba2b035ac79968595990a)

            to branch 'au.asn.ucc.matt.dropbear.channel-fix' (head fc77c3dea87a7c0f374e738d055f0b455495cbc3)

--HG--
branch : channel-fix
extra : convert_revision : dec459c955c306f9ecddc3b4e04a963f3f264a0f
parents d9aeb277 ede9a990
No related merge requests found
......@@ -73,10 +73,9 @@ struct Channel {
circbuffer *extrabuf; /* extended-data for the program - used like writebuf
but for stderr */
int sentclosed, recvclosed;
/* this is set when we receive/send a channel eof packet */
int recveof, senteof;
/* whether close/eof messages have been exchanged */
int sent_close, recv_close;
int recv_eof, sent_eof;
int initconn; /* used for TCP forwarding, whether the channel has been
fully initialised */
......@@ -94,7 +93,7 @@ struct ChanType {
int sepfds; /* Whether this channel has seperate pipes for in/out or not */
char *name;
int (*inithandler)(struct Channel*);
int (*checkclose)(struct Channel*);
int (*check_close)(struct Channel*);
void (*reqhandler)(struct Channel*);
void (*closehandler)(struct Channel*);
......
......@@ -39,9 +39,6 @@ void recv_msg_channel_extended_data() {
TRACE(("enter recv_msg_channel_extended_data"))
channel = getchannel();
if (channel == NULL) {
dropbear_exit("Unknown channel");
}
if (channel->type != &clichansess) {
TRACE(("leave recv_msg_channel_extended_data: chantype is wrong"))
......
This diff is collapsed.
......@@ -143,27 +143,21 @@ void session_loop(void(*loophandler)()) {
dropbear_exit("Terminated by signal");
}
if (val < 0) {
if (errno == EINTR) {
/* This must happen even if we've been interrupted, so that
* changed signal-handler vars can take effect etc */
if (loophandler) {
loophandler();
}
continue;
} else {
dropbear_exit("Error in select");
}
if (val < 0 && errno != EINTR) {
dropbear_exit("Error in select");
}
if (val <= 0) {
/* If we were interrupted or the select timed out, we still
* want to iterate over channels etc for reading, to handle
* server processes exiting etc.
* We don't want to read/write FDs. */
FD_ZERO(&writefd);
FD_ZERO(&readfd);
}
/* check for auth timeout, rekeying required etc */
checktimeouts();
if (val == 0) {
/* timeout */
TRACE(("select timeout"))
continue;
}
/* process session socket's incoming/outgoing data */
if (ses.sock != -1) {
......
......@@ -39,7 +39,7 @@
* Caution: Don't use this in an unfriendly environment (ie unfirewalled),
* since the printing may not sanitise strings etc. This will add a reasonable
* amount to your executable size. */
/*#define DEBUG_TRACE */
#define DEBUG_TRACE
/* All functions writing to the cleartext payload buffer call
* CHECKCLEARTOWRITE() before writing. This is only really useful if you're
......
......@@ -59,7 +59,6 @@ static void send_msg_chansess_exitstatus(struct Channel * channel,
struct ChanSess * chansess);
static void send_msg_chansess_exitsignal(struct Channel * channel,
struct ChanSess * chansess);
static int sesscheckclose(struct Channel *channel);
static void get_termmodes(struct ChanSess *chansess);
......@@ -68,7 +67,7 @@ extern char** environ;
static int sesscheckclose(struct Channel *channel) {
struct ChanSess *chansess = (struct ChanSess*)channel->typedata;
return chansess->exit.exitpid >= 0;
return chansess->exit.exitpid != -1;
}
/* Handler for childs exiting, store the state for return to the client */
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment