mirror of
https://github.com/clearml/dropbear
synced 2025-02-07 21:23:51 +00:00
Don't leave the stdin FD non-blocking on exit - busybox doesn't like it.
--HG-- extra : convert_revision : 9c2b10bf10f9d38f62490346b53268a07afa0c3a
This commit is contained in:
parent
e17d27d91d
commit
a69e355a06
@ -63,6 +63,10 @@ static void cli_closechansess(struct Channel *channel) {
|
|||||||
|
|
||||||
cli_tty_cleanup(); /* Restore tty modes etc */
|
cli_tty_cleanup(); /* Restore tty modes etc */
|
||||||
|
|
||||||
|
/* Set stdin back to non-blocking - busybox ash dies nastily
|
||||||
|
* if we don't revert the flags */
|
||||||
|
fcntl(cli_ses.stdincopy, F_SETFL, cli_ses.stdinflags);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void start_channel_request(struct Channel *channel,
|
static void start_channel_request(struct Channel *channel,
|
||||||
@ -313,6 +317,11 @@ static void send_chansess_shell_req(struct Channel *channel) {
|
|||||||
|
|
||||||
static int cli_initchansess(struct Channel *channel) {
|
static int cli_initchansess(struct Channel *channel) {
|
||||||
|
|
||||||
|
/* We store stdin's flags, so we can set them back on exit (otherwise
|
||||||
|
* busybox's ash isn't happy */
|
||||||
|
cli_ses.stdincopy = dup(STDIN_FILENO);
|
||||||
|
cli_ses.stdinflags = fcntl(STDIN_FILENO, F_GETFL, 0);
|
||||||
|
|
||||||
channel->infd = STDOUT_FILENO;
|
channel->infd = STDOUT_FILENO;
|
||||||
//channel->outfd = STDIN_FILENO;
|
//channel->outfd = STDIN_FILENO;
|
||||||
//channel->errfd = STDERR_FILENO;
|
//channel->errfd = STDERR_FILENO;
|
||||||
|
@ -212,6 +212,8 @@ struct clientsession {
|
|||||||
|
|
||||||
int tty_raw_mode; /* Whether we're in raw mode (and have to clean up) */
|
int tty_raw_mode; /* Whether we're in raw mode (and have to clean up) */
|
||||||
struct termios saved_tio;
|
struct termios saved_tio;
|
||||||
|
int stdincopy;
|
||||||
|
int stdinflags;
|
||||||
|
|
||||||
int winchange; /* Set to 1 when a windowchange signal happens */
|
int winchange; /* Set to 1 when a windowchange signal happens */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user