version 1.232, 2011/04/17 22:42:41 |
version 1.233, 2011/05/06 21:34:32 |
|
|
*/ |
*/ |
extern char *host; |
extern char *host; |
|
|
/* Force TTY allocation */ |
|
extern int force_tty_flag; |
|
|
|
/* |
/* |
* Flag to indicate that we have received a window change signal which has |
* Flag to indicate that we have received a window change signal which has |
* not yet been processed. This will cause a message indicating the new |
* not yet been processed. This will cause a message indicating the new |
|
|
atomicio(vwrite, fileno(stderr), buffer_ptr(berr), |
atomicio(vwrite, fileno(stderr), buffer_ptr(berr), |
buffer_len(berr)); |
buffer_len(berr)); |
|
|
leave_raw_mode(force_tty_flag); |
leave_raw_mode(options.request_tty == REQUEST_TTY_FORCE); |
|
|
/* |
/* |
* Free (and clear) the buffer to reduce the amount of data that gets |
* Free (and clear) the buffer to reduce the amount of data that gets |
|
|
buffer_init(bout); |
buffer_init(bout); |
buffer_init(berr); |
buffer_init(berr); |
|
|
enter_raw_mode(force_tty_flag); |
enter_raw_mode(options.request_tty == REQUEST_TTY_FORCE); |
} |
} |
|
|
static void |
static void |
|
|
bzero(&fwd, sizeof(fwd)); |
bzero(&fwd, sizeof(fwd)); |
fwd.listen_host = fwd.connect_host = NULL; |
fwd.listen_host = fwd.connect_host = NULL; |
|
|
leave_raw_mode(force_tty_flag); |
leave_raw_mode(options.request_tty == REQUEST_TTY_FORCE); |
handler = signal(SIGINT, SIG_IGN); |
handler = signal(SIGINT, SIG_IGN); |
cmd = s = read_passphrase("\r\nssh> ", RP_ECHO); |
cmd = s = read_passphrase("\r\nssh> ", RP_ECHO); |
if (s == NULL) |
if (s == NULL) |
|
|
|
|
out: |
out: |
signal(SIGINT, handler); |
signal(SIGINT, handler); |
enter_raw_mode(force_tty_flag); |
enter_raw_mode(options.request_tty == REQUEST_TTY_FORCE); |
if (cmd) |
if (cmd) |
xfree(cmd); |
xfree(cmd); |
if (fwd.listen_host != NULL) |
if (fwd.listen_host != NULL) |
|
|
* more new connections). |
* more new connections). |
*/ |
*/ |
/* Restore tty modes. */ |
/* Restore tty modes. */ |
leave_raw_mode(force_tty_flag); |
leave_raw_mode( |
|
options.request_tty == REQUEST_TTY_FORCE); |
|
|
/* Stop listening for new connections. */ |
/* Stop listening for new connections. */ |
channel_stop_listening(); |
channel_stop_listening(); |
|
|
{ |
{ |
channel_cancel_cleanup(id); |
channel_cancel_cleanup(id); |
session_closed = 1; |
session_closed = 1; |
leave_raw_mode(force_tty_flag); |
leave_raw_mode(options.request_tty == REQUEST_TTY_FORCE); |
} |
} |
|
|
/* |
/* |
|
|
signal(SIGWINCH, window_change_handler); |
signal(SIGWINCH, window_change_handler); |
|
|
if (have_pty) |
if (have_pty) |
enter_raw_mode(force_tty_flag); |
enter_raw_mode(options.request_tty == REQUEST_TTY_FORCE); |
|
|
if (compat20) { |
if (compat20) { |
session_ident = ssh2_chan_id; |
session_ident = ssh2_chan_id; |
|
|
channel_free_all(); |
channel_free_all(); |
|
|
if (have_pty) |
if (have_pty) |
leave_raw_mode(force_tty_flag); |
leave_raw_mode(options.request_tty == REQUEST_TTY_FORCE); |
|
|
/* restore blocking io */ |
/* restore blocking io */ |
if (!isatty(fileno(stdin))) |
if (!isatty(fileno(stdin))) |
|
|
void |
void |
cleanup_exit(int i) |
cleanup_exit(int i) |
{ |
{ |
leave_raw_mode(force_tty_flag); |
leave_raw_mode(options.request_tty == REQUEST_TTY_FORCE); |
leave_non_blocking(); |
leave_non_blocking(); |
if (options.control_path != NULL && muxserver_sock != -1) |
if (options.control_path != NULL && muxserver_sock != -1) |
unlink(options.control_path); |
unlink(options.control_path); |