Bugzilla – Attachment 2141 Details for
Bug 1995
RequestTTY=no in config doesn't work if stdin is not a tty
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch fixing RequestTTY=no that is not taken into account for non-tty stdin if set in config
0001-Move-log-init-and-config-reading-before-TTY-affairs.patch (text/plain), 3.08 KB, created by
Przemysław Pawełczyk
on 2012-04-01 21:10:05 AEST
(
hide
)
Description:
Patch fixing RequestTTY=no that is not taken into account for non-tty stdin if set in config
Filename:
MIME Type:
Creator:
Przemysław Pawełczyk
Created:
2012-04-01 21:10:05 AEST
Size:
3.08 KB
patch
obsolete
>From 18c63375838fe562267c976586241efbb738c1bd Mon Sep 17 00:00:00 2001 >From: Przemyslaw Pawelczyk <przemoc@gmail.com> >Date: Sun, 18 Mar 2012 14:26:23 +0100 >Subject: [PATCH] Move log init and config reading before TTY affairs. > >Crucial code flow fix to make RequestTTY option fully working, >thus avoiding superfluous message: > > Pseudo-terminal will not be allocated because > stdin is not a terminal. >--- > ssh.c | 66 ++++++++++++++++++++++++++++++++-------------------------------- > 1 files changed, 33 insertions(+), 33 deletions(-) > >diff --git a/ssh.c b/ssh.c >index 68e1315..9a2553f 100644 >--- a/ssh.c >+++ b/ssh.c >@@ -638,6 +638,39 @@ main(int ac, char **av) > /* Initialize the command to execute on remote host. */ > buffer_init(&command); > >+ /* >+ * Initialize "log" output. Since we are the client all output >+ * actually goes to stderr. >+ */ >+ log_init(argv0, >+ options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level, >+ SYSLOG_FACILITY_USER, !use_syslog); >+ >+ /* >+ * Read per-user configuration file. Ignore the system wide config >+ * file if the user specifies a config file on the command line. >+ */ >+ if (config != NULL) { >+ if (!read_config_file(config, host, &options, 0)) >+ fatal("Can't open user config file %.100s: " >+ "%.100s", config, strerror(errno)); >+ } else { >+ r = snprintf(buf, sizeof buf, "%s/%s", pw->pw_dir, >+ _PATH_SSH_USER_CONFFILE); >+ if (r > 0 && (size_t)r < sizeof(buf)) >+ (void)read_config_file(buf, host, &options, 1); >+ >+ /* Read systemwide configuration file after user config. */ >+ (void)read_config_file(_PATH_HOST_CONFIG_FILE, host, >+ &options, 0); >+ } >+ >+ /* Fill configuration defaults. */ >+ fill_default_options(&options); >+ >+ /* 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; >@@ -686,41 +719,8 @@ main(int ac, char **av) > tty_flag = 0; > } > >- /* >- * Initialize "log" output. Since we are the client all output >- * actually goes to stderr. >- */ >- log_init(argv0, >- options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level, >- SYSLOG_FACILITY_USER, !use_syslog); >- >- /* >- * Read per-user configuration file. Ignore the system wide config >- * file if the user specifies a config file on the command line. >- */ >- if (config != NULL) { >- if (!read_config_file(config, host, &options, 0)) >- fatal("Can't open user config file %.100s: " >- "%.100s", config, strerror(errno)); >- } else { >- r = snprintf(buf, sizeof buf, "%s/%s", pw->pw_dir, >- _PATH_SSH_USER_CONFFILE); >- if (r > 0 && (size_t)r < sizeof(buf)) >- (void)read_config_file(buf, host, &options, 1); >- >- /* Read systemwide configuration file after user config. */ >- (void)read_config_file(_PATH_HOST_CONFIG_FILE, host, >- &options, 0); >- } >- >- /* Fill configuration defaults. */ >- fill_default_options(&options); >- > channel_set_af(options.address_family); > >- /* reinit */ >- log_init(argv0, options.log_level, SYSLOG_FACILITY_USER, !use_syslog); >- > seed_rng(); > > if (options.user == NULL) >-- >1.7.9.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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1995
:
2141
|
2171