mirror of
https://github.com/clearml/dropbear
synced 2025-02-12 07:25:30 +00:00
Fix ses.channel_signal_pending race
This commit is contained in:
parent
33b2fbb5ef
commit
ee353847be
@ -255,8 +255,6 @@ void channelio(fd_set *readfds, fd_set *writefds) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ses.channel_signal_pending = 0;
|
|
||||||
|
|
||||||
#ifdef USING_LISTENERS
|
#ifdef USING_LISTENERS
|
||||||
handle_listeners(readfds);
|
handle_listeners(readfds);
|
||||||
#endif
|
#endif
|
||||||
|
@ -162,6 +162,7 @@ void session_loop(void(*loophandler)()) {
|
|||||||
/* We get woken up when signal handlers write to this pipe.
|
/* We get woken up when signal handlers write to this pipe.
|
||||||
SIGCHLD in svr-chansession is the only one currently. */
|
SIGCHLD in svr-chansession is the only one currently. */
|
||||||
FD_SET(ses.signal_pipe[0], &readfd);
|
FD_SET(ses.signal_pipe[0], &readfd);
|
||||||
|
ses.channel_signal_pending = 0;
|
||||||
|
|
||||||
/* set up for channels which can be read/written */
|
/* set up for channels which can be read/written */
|
||||||
setchannelfds(&readfd, &writefd, writequeue_has_space);
|
setchannelfds(&readfd, &writefd, writequeue_has_space);
|
||||||
@ -211,7 +212,9 @@ void session_loop(void(*loophandler)()) {
|
|||||||
wake up the select() above. */
|
wake up the select() above. */
|
||||||
if (FD_ISSET(ses.signal_pipe[0], &readfd)) {
|
if (FD_ISSET(ses.signal_pipe[0], &readfd)) {
|
||||||
char x;
|
char x;
|
||||||
|
TRACE(("signal pipe set"))
|
||||||
while (read(ses.signal_pipe[0], &x, 1) > 0) {}
|
while (read(ses.signal_pipe[0], &x, 1) > 0) {}
|
||||||
|
ses.channel_signal_pending = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check for auth timeout, rekeying required etc */
|
/* check for auth timeout, rekeying required etc */
|
||||||
|
Loading…
Reference in New Issue
Block a user