From 7b30501bf53c3d5df9691f8e52b1f76bb61f2a35 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 2 Jul 2012 18:55:09 +1000 Subject: - dtucker@cvs.openbsd.org 2012/07/02 08:50:03 [ssh.c] set interactive ToS for forwarded X11 sessions. ok djm@ --- ssh.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ssh.c') diff --git a/ssh.c b/ssh.c index 68e131527..3c376d0ff 100644 --- a/ssh.c +++ b/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.368 2011/10/24 02:10:46 djm Exp $ */ +/* $OpenBSD: ssh.c,v 1.369 2012/07/02 08:50:03 dtucker Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1359,6 +1359,10 @@ ssh_session2_setup(int id, int success, void *arg) packet_send(); } + /* Tell the packet module whether this is an interactive session. */ + packet_set_interactive(interactive, + options.ip_qos_interactive, options.ip_qos_bulk); + client_session2_setup(id, tty_flag, subsystem_flag, getenv("TERM"), NULL, fileno(stdin), &command, environ); } -- cgit v1.2.3 From fff9f095e2f47a4d554b93a247cbcaca5a3baecf Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 6 Jul 2012 13:45:01 +1000 Subject: - djm@cvs.openbsd.org 2012/07/06 01:47:38 [ssh.c] move setting of tty_flag to after config parsing so RequestTTY options are correctly picked up. bz#1995 patch from przemoc AT gmail.com; ok dtucker@ --- ChangeLog | 5 +++++ ssh.c | 43 +++++++++++++++++++++---------------------- 2 files changed, 26 insertions(+), 22 deletions(-) (limited to 'ssh.c') diff --git a/ChangeLog b/ChangeLog index 68811e63b..07c17486d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,11 @@ fix memory leak of passed-in environment variables and connection context when new session message is malformed; bz#2003 from Bert.Wesarg AT googlemail.com + - djm@cvs.openbsd.org 2012/07/06 01:47:38 + [ssh.c] + move setting of tty_flag to after config parsing so RequestTTY options + are correctly picked up. bz#1995 patch from przemoc AT gmail.com; + ok dtucker@ 20120704 - (dtucker) [configure.ac openbsd-compat/bsd-misc.h] Add setlinebuf for diff --git a/ssh.c b/ssh.c index 3c376d0ff..3f61eb028 100644 --- a/ssh.c +++ b/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.369 2012/07/02 08:50:03 dtucker Exp $ */ +/* $OpenBSD: ssh.c,v 1.370 2012/07/06 01:47:38 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -638,10 +638,6 @@ main(int ac, char **av) /* Initialize the command to execute on remote host. */ buffer_init(&command); - if (options.request_tty == REQUEST_TTY_YES || - options.request_tty == REQUEST_TTY_FORCE) - tty_flag = 1; - /* * Save the command to execute on the remote host in a buffer. There * is no limit on the length of the command, except by the maximum @@ -649,7 +645,6 @@ main(int ac, char **av) */ if (!ac) { /* No command specified - execute shell on a tty. */ - tty_flag = options.request_tty != REQUEST_TTY_NO; if (subsystem_flag) { fprintf(stderr, "You must specify a subsystem to invoke.\n"); @@ -670,22 +665,6 @@ main(int ac, char **av) fatal("Cannot fork into background without a command " "to execute."); - /* Allocate a tty by default if no command specified. */ - if (buffer_len(&command) == 0) - tty_flag = options.request_tty != REQUEST_TTY_NO; - - /* Force no tty */ - if (options.request_tty == REQUEST_TTY_NO || muxclient_command != 0) - tty_flag = 0; - /* Do not allocate a tty if stdin is not a tty. */ - if ((!isatty(fileno(stdin)) || stdin_null_flag) && - options.request_tty != REQUEST_TTY_FORCE) { - if (tty_flag) - logit("Pseudo-terminal will not be allocated because " - "stdin is not a terminal."); - tty_flag = 0; - } - /* * Initialize "log" output. Since we are the client all output * actually goes to stderr. @@ -721,6 +700,26 @@ main(int ac, char **av) /* reinit */ log_init(argv0, options.log_level, SYSLOG_FACILITY_USER, !use_syslog); + if (options.request_tty == REQUEST_TTY_YES || + options.request_tty == REQUEST_TTY_FORCE) + tty_flag = 1; + + /* Allocate a tty by default if no command specified. */ + if (buffer_len(&command) == 0) + tty_flag = options.request_tty != REQUEST_TTY_NO; + + /* Force no tty */ + if (options.request_tty == REQUEST_TTY_NO || muxclient_command != 0) + tty_flag = 0; + /* Do not allocate a tty if stdin is not a tty. */ + if ((!isatty(fileno(stdin)) || stdin_null_flag) && + options.request_tty != REQUEST_TTY_FORCE) { + if (tty_flag) + logit("Pseudo-terminal will not be allocated because " + "stdin is not a terminal."); + tty_flag = 0; + } + seed_rng(); if (options.user == NULL) -- cgit v1.2.3