Bugzilla – Attachment 1751 Details for
Bug 1689
test bug
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
suppress-ttyforce.diff
suppress-ttyforce.diff (text/plain), 5.14 KB, created by
Damien Miller
on 2009-12-21 11:33:33 AEDT
(
hide
)
Description:
suppress-ttyforce.diff
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2009-12-21 11:33:33 AEDT
Size:
5.14 KB
patch
obsolete
>Index: clientloop.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/clientloop.c,v >retrieving revision 1.215 >diff -u -p -r1.215 clientloop.c >--- clientloop.c 17 Nov 2009 05:31:44 -0000 1.215 >+++ clientloop.c 20 Dec 2009 23:40:54 -0000 >@@ -122,6 +122,9 @@ extern int muxserver_sock; > */ > extern char *host; > >+/* Force TTY allocation */ >+extern int force_tty_flag; >+ > /* > * 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 >@@ -602,7 +605,7 @@ client_suspend_self(Buffer *bin, Buffer > atomicio(vwrite, fileno(stderr), buffer_ptr(berr), > buffer_len(berr)); > >- leave_raw_mode(); >+ leave_raw_mode(force_tty_flag); > > /* > * Free (and clear) the buffer to reduce the amount of data that gets >@@ -623,7 +626,7 @@ client_suspend_self(Buffer *bin, Buffer > buffer_init(bout); > buffer_init(berr); > >- enter_raw_mode(); >+ enter_raw_mode(force_tty_flag); > } > > static void >@@ -765,7 +768,7 @@ process_cmdline(void) > bzero(&fwd, sizeof(fwd)); > fwd.listen_host = fwd.connect_host = NULL; > >- leave_raw_mode(); >+ leave_raw_mode(force_tty_flag); > handler = signal(SIGINT, SIG_IGN); > cmd = s = read_passphrase("\r\nssh> ", RP_ECHO); > if (s == NULL) >@@ -868,7 +871,7 @@ process_cmdline(void) > > out: > signal(SIGINT, handler); >- enter_raw_mode(); >+ enter_raw_mode(force_tty_flag); > if (cmd) > xfree(cmd); > if (fwd.listen_host != NULL) >@@ -987,7 +990,7 @@ process_escapes(Channel *c, Buffer *bin, > * more new connections). > */ > /* Restore tty modes. */ >- leave_raw_mode(); >+ leave_raw_mode(force_tty_flag); > > /* Stop listening for new connections. */ > channel_stop_listening(); >@@ -1279,7 +1282,7 @@ client_channel_closed(int id, void *arg) > { > channel_cancel_cleanup(id); > session_closed = 1; >- leave_raw_mode(); >+ leave_raw_mode(force_tty_flag); > } > > /* >@@ -1352,7 +1355,7 @@ client_loop(int have_pty, int escape_cha > signal(SIGWINCH, window_change_handler); > > if (have_pty) >- enter_raw_mode(); >+ enter_raw_mode(force_tty_flag); > > if (compat20) { > session_ident = ssh2_chan_id; >@@ -1486,7 +1489,7 @@ client_loop(int have_pty, int escape_cha > channel_free_all(); > > if (have_pty) >- leave_raw_mode(); >+ leave_raw_mode(force_tty_flag); > > /* restore blocking io */ > if (!isatty(fileno(stdin))) >@@ -2044,7 +2047,7 @@ client_init_dispatch(void) > void > cleanup_exit(int i) > { >- leave_raw_mode(); >+ leave_raw_mode(force_tty_flag); > leave_non_blocking(); > if (options.control_path != NULL && muxserver_sock != -1) > unlink(options.control_path); >Index: mux.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/mux.c,v >retrieving revision 1.8 >diff -u -p -r1.8 mux.c >--- mux.c 20 Aug 2009 23:54:28 -0000 1.8 >+++ mux.c 20 Dec 2009 23:40:54 -0000 >@@ -71,6 +71,7 @@ > > /* from ssh.c */ > extern int tty_flag; >+extern int force_tty_flag; > extern Options options; > extern int stdin_null_flag; > extern char *host; >@@ -671,7 +672,7 @@ muxclient(const char *path) > signal(SIGWINCH, control_client_sigrelay); > > if (tty_flag) >- enter_raw_mode(); >+ enter_raw_mode(force_tty_flag); > > /* > * Stick around until the controlee closes the client_fd. >@@ -696,7 +697,7 @@ muxclient(const char *path) > } > > close(sock); >- leave_raw_mode(); >+ leave_raw_mode(force_tty_flag); > if (i > (int)sizeof(int)) > fatal("%s: master returned too much data (%d > %lu)", > __func__, i, (u_long)sizeof(int)); >Index: sshpty.h >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/sshpty.h,v >retrieving revision 1.11 >diff -u -p -r1.11 sshpty.h >--- sshpty.h 19 May 2008 15:45:07 -0000 1.11 >+++ sshpty.h 20 Dec 2009 23:40:55 -0000 >@@ -17,8 +17,8 @@ > #include <termios.h> > > struct termios *get_saved_tio(void); >-void leave_raw_mode(void); >-void enter_raw_mode(void); >+void leave_raw_mode(int); >+void enter_raw_mode(int); > > int pty_allocate(int *, int *, char *, size_t); > void pty_release(const char *); >Index: sshtty.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/sshtty.c,v >retrieving revision 1.13 >diff -u -p -r1.13 sshtty.c >--- sshtty.c 19 May 2008 15:45:07 -0000 1.13 >+++ sshtty.c 20 Dec 2009 23:40:55 -0000 >@@ -52,23 +52,25 @@ get_saved_tio(void) > } > > void >-leave_raw_mode(void) >+leave_raw_mode(int quiet) > { > if (!_in_raw_mode) > return; >- if (tcsetattr(fileno(stdin), TCSADRAIN, &_saved_tio) == -1) >- perror("tcsetattr"); >- else >+ if (tcsetattr(fileno(stdin), TCSADRAIN, &_saved_tio) == -1) { >+ if (!quiet) >+ perror("tcsetattr"); >+ } else > _in_raw_mode = 0; > } > > void >-enter_raw_mode(void) >+enter_raw_mode(int quiet) > { > struct termios tio; > > if (tcgetattr(fileno(stdin), &tio) == -1) { >- perror("tcgetattr"); >+ if (!quiet) >+ perror("tcgetattr"); > return; > } > _saved_tio = tio; >@@ -84,8 +86,9 @@ enter_raw_mode(void) > tio.c_oflag &= ~OPOST; > tio.c_cc[VMIN] = 1; > tio.c_cc[VTIME] = 0; >- if (tcsetattr(fileno(stdin), TCSADRAIN, &tio) == -1) >- perror("tcsetattr"); >- else >+ if (tcsetattr(fileno(stdin), TCSADRAIN, &tio) == -1) { >+ if (!quiet) >+ perror("tcsetattr"); >+ } else > _in_raw_mode = 1; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1689
:
1749
|
1750
| 1751 |
1752
|
1753
|
1754
|
1755
|
1756
|
1757
|
1758
|
1759
|
1760