Bugzilla – Attachment 2171 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]
move initialisation of tty_flag to after config parsing
requesttty.diff (text/plain), 2.50 KB, created by
Damien Miller
on 2012-07-06 10:48:47 AEST
(
hide
)
Description:
move initialisation of tty_flag to after config parsing
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2012-07-06 10:48:47 AEST
Size:
2.50 KB
patch
obsolete
>Index: ssh.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/ssh.c,v >retrieving revision 1.369 >diff -u -p -r1.369 ssh.c >--- ssh.c 2 Jul 2012 08:50:03 -0000 1.369 >+++ ssh.c 6 Jul 2012 00:43:31 -0000 >@@ -609,10 +609,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 >@@ -620,7 +616,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"); >@@ -641,22 +636,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. >@@ -691,6 +670,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; >+ } > > if (options.user == NULL) > options.user = xstrdup(pw->pw_name);
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
Flags:
dtucker
:
ok+
Actions:
View
|
Diff
Attachments on
bug 1995
:
2141
| 2171