mirror of
https://github.com/clearml/dropbear
synced 2025-06-26 18:17:32 +00:00
Make sure client exit messages don't get lost
This commit is contained in:
parent
50a5d3756f
commit
1ccac01cee
@ -107,9 +107,10 @@ static void cli_dropbear_exit(int exitcode, const char* format, va_list param) {
|
|||||||
|
|
||||||
/* Do the cleanup first, since then the terminal will be reset */
|
/* Do the cleanup first, since then the terminal will be reset */
|
||||||
session_cleanup();
|
session_cleanup();
|
||||||
|
/* Avoid printing onwards from terminal cruft */
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
|
||||||
_dropbear_log(LOG_INFO, fmtbuf, param);
|
_dropbear_log(LOG_INFO, fmtbuf, param);
|
||||||
|
|
||||||
exit(exitcode);
|
exit(exitcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +122,7 @@ static void cli_dropbear_log(int UNUSED(priority),
|
|||||||
vsnprintf(printbuf, sizeof(printbuf), format, param);
|
vsnprintf(printbuf, sizeof(printbuf), format, param);
|
||||||
|
|
||||||
fprintf(stderr, "%s: %s\n", cli_opts.progname, printbuf);
|
fprintf(stderr, "%s: %s\n", cli_opts.progname, printbuf);
|
||||||
|
fflush(stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void exec_proxy_cmd(void *user_data_cmd) {
|
static void exec_proxy_cmd(void *user_data_cmd) {
|
||||||
|
@ -574,14 +574,16 @@ static void remove_channel(struct Channel * channel) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* close the FDs in case they haven't been done
|
if (IS_DROPBEAR_SERVER || (channel->writefd != STDOUT_FILENO)) {
|
||||||
* yet (they might have been shutdown etc) */
|
/* close the FDs in case they haven't been done
|
||||||
TRACE(("CLOSE writefd %d", channel->writefd))
|
* yet (they might have been shutdown etc) */
|
||||||
close(channel->writefd);
|
TRACE(("CLOSE writefd %d", channel->writefd))
|
||||||
TRACE(("CLOSE readfd %d", channel->readfd))
|
close(channel->writefd);
|
||||||
close(channel->readfd);
|
TRACE(("CLOSE readfd %d", channel->readfd))
|
||||||
TRACE(("CLOSE errfd %d", channel->errfd))
|
close(channel->readfd);
|
||||||
close(channel->errfd);
|
TRACE(("CLOSE errfd %d", channel->errfd))
|
||||||
|
close(channel->errfd);
|
||||||
|
}
|
||||||
|
|
||||||
if (!channel->close_handler_done
|
if (!channel->close_handler_done
|
||||||
&& channel->type->closehandler) {
|
&& channel->type->closehandler) {
|
||||||
|
Loading…
Reference in New Issue
Block a user