Bug 1995 - RequestTTY=no in config doesn't work if stdin is not a tty
Summary: RequestTTY=no in config doesn't work if stdin is not a tty
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: -current
Hardware: All All
: P2 normal
Assignee: Damien Miller
URL:
Keywords:
Depends on:
Blocks: V_6_1
  Show dependency treegraph
 
Reported: 2012-04-01 21:10 AEST by Przemysław Pawełczyk
Modified: 2015-08-11 23:04 AEST (History)
0 users

See Also:


Attachments
Patch fixing RequestTTY=no that is not taken into account for non-tty stdin if set in config (3.08 KB, patch)
2012-04-01 21:10 AEST, Przemysław Pawełczyk
no flags Details | Diff
move initialisation of tty_flag to after config parsing (2.50 KB, patch)
2012-07-06 10:48 AEST, Damien Miller
dtucker: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Przemysław Pawełczyk 2012-04-01 21:10:05 AEST
Created attachment 2141 [details]
Patch fixing RequestTTY=no that is not taken into account for non-tty stdin if set in config

I've already reported the problem almost two weeks ago at #openssh, but apparently developers are available there only virtually (and I agree it's possibly not the best place for such activity). So this time I'm writing more proper bug report using bugzilla.

I've noticed that RequestTTY option added in 8bf1740144a4 (May 2011) is not working 100% as intended (unless used in command-line). I checked the source code and it's because some tty stuff (touching options.request_tty) is performed before reading config file.

I think that init log output, read per-user config, fill defaults and log reinit should be put just after buffer_init(...).
Such fix has been tested and it seems to be working fine, but I may overlooked some (corner) cases, so please look at my solution in a cagey manner.

Thanks.
Comment 1 Damien Miller 2012-07-06 10:48:47 AEST
Created attachment 2171 [details]
move initialisation of tty_flag to after config parsing

The original patch seems no longer to apply. Here's a regenerated one.
Comment 2 Damien Miller 2012-07-06 11:47:53 AEST
patch applied. this will be in openssh-6.1 - thanks!
Comment 3 Damien Miller 2015-08-11 23:04:14 AEST
Set all RESOLVED bugs to CLOSED with release of OpenSSH 7.1