Bug 2386 - TERM env variable is always accepted by sshd, regardless the empty AcceptEnv setting
Summary: TERM env variable is always accepted by sshd, regardless the empty AcceptEnv ...
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Documentation (show other bugs)
Version: 6.8p1
Hardware: All All
: P5 enhancement
Assignee: Darren Tucker
URL:
Keywords:
Depends on:
Blocks: V_6_9
  Show dependency treegraph
 
Reported: 2015-04-18 01:39 AEST by Jakub Jelen
Modified: 2021-04-23 15:03 AEST (History)
4 users (show)

See Also:


Attachments
proposed patch (1022 bytes, text/plain)
2015-04-18 01:39 AEST, Jakub Jelen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelen 2015-04-18 01:39:46 AEST
Created attachment 2597 [details]
proposed patch

In our Red Hat bugzilla, we have such report, that this is not expected behaviour.
For us it is obvious, that TERM variable is send and accepted regardless configuration, because it is part of protocol. This doesn't have to be obvious for some users so it should be mentioned in manual pages. I propose such simple sentence (see attached patch).
Comment 1 Darren Tucker 2015-04-28 20:19:50 AEST
Committed a reworked patch.  Thanks, it will be in the 6.9 release.
Comment 2 Jakub Jelen 2015-05-29 17:15:24 AEST
I didn't check what you wrote there (unfortunately). Few remarks for your upstream commits:
https://anongit.mindrot.org/openssh.git/commit/?id=85b96ef41374f3ddc9139581f87da09b2cd9199e
https://anongit.mindrot.org/openssh.git/commit/?id=43beea053db191cac47c2cd8d3dc1930158aff1a
https://anongit.mindrot.org/openssh.git/commit/?id=c1d5bcf1aaf1209af02f79e48ba1cbc76a87b56f

ssh_config is ok
sshd_config:
> environment variable is always sent whenever the client
> requests a pseudo-terminal is requested as it is required by the protocol.
 * variable is not sent, but accepted
 * "requests a pseudo-terminal is requested" doesn't make sense
   * [...] client requests a pseudo-terminal [...]
   * or
   * [...] a pseudo-terminal is requested [...]
   * but please not both
Comment 3 Damien Miller 2015-06-05 13:44:40 AEST
fixed, thanks

-requests a pseudo-terminal is requested as it is required by the protocol.
+requests a pseudo-terminal as it is required by the protocol.
Comment 4 Christoph Anton Mitterer 2015-11-02 15:48:07 AEDT
Reopening this, as the manpage in master still reads:
"environment variable is always sent whenever the client"
for the AcceptEnv directive, while it should read "... accpted ..." as it has been pointed out by Jakub before.

Cheers,
Chris.
Comment 5 Christoph Anton Mitterer 2015-11-02 15:51:41 AEDT
Oh and one more:

I would at least hope (though I haven't checked) that TERM is only accepted when sshd actually allows to create a PTY (can someone check whether this is the case?).

Therefore it should read:
"whenever a pseudoterminal is created as it is required by the protocol."
because it may not be created even if requested by the client, namely if forbidden e.g. by PermitTTY.
Comment 6 Damien Miller 2018-06-09 13:19:02 AEST
Fixed s/sent/accepted/

Someone fixes the duplicated phase a while back.
Comment 7 Damien Miller 2021-04-23 15:03:33 AEST
closing resolved bugs as of 8.6p1 release