Bug 1153 - DISPLAY should be set form the connected IP, not the hostname
Summary: DISPLAY should be set form the connected IP, not the hostname
Status: ASSIGNED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: 4.3p1
Hardware: All All
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_9_4
  Show dependency treegraph
 
Reported: 2006-02-09 22:43 AEDT by Simon Vallet
Modified: 2023-03-17 13:33 AEDT (History)
2 users (show)

See Also:


Attachments
Patch against 20060208 -- see bug report for details (1.56 KB, patch)
2006-02-09 22:44 AEDT, Simon Vallet
tylercashea33: ok+
tylercashea33: ok+
Details | Diff
Set $DISPLAY to match what xauth ends up using (1.53 KB, patch)
2006-08-20 15:49 AEST, Darren Tucker
djm: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Vallet 2006-02-09 22:43:31 AEDT
When forwarding X11 connections, the DISPLAY variable should be set to match the appropriate interface when X11UseLocalhost is set to "no".

Current behaviour is to set DISPLAY from a call to gethostname(), which may not return the wanted value, especially on multi-homed hosts.

Attached is a patch against 20060208 which solves the problem by using the connected socket's IP.
Comment 1 Simon Vallet 2006-02-09 22:44:59 AEDT
Created attachment 1064 [details]
Patch against 20060208 -- see bug report for details
Comment 2 Darren Tucker 2006-08-20 15:49:44 AEST
Created attachment 1178 [details]
Set $DISPLAY to match what xauth ends up using

Alternative solution: make sshd set $DISPLAY according to what xauth ends up using.  See the discussion thread here:
http://marc.theaimsgroup.com/?l=openssh-unix-dev&m=114044767308984
Comment 3 Simon Vallet 2006-09-29 19:44:28 AEST
OK, applied and tested against 4.4p1 this morning : the patch works as intended -- too bad I couldn't make it for the 4.4 release.

I'm marking this as fixed
Comment 4 Darren Tucker 2006-09-29 20:06:01 AEST
I think we might leave this open until we decide what to do with it.  Closed bugs pass beyond the attention horizon pretty quick :-).
Comment 5 Simon Vallet 2006-09-29 20:29:01 AEST
Hmmm... I thought 'resolved' and 'closed' were two different states -- I guess you need more feedback before applying this, which seems reasonable. 

Just tell me if I can provide some more testing on my side
Comment 6 Darren Tucker 2006-09-29 20:51:52 AEST
We normally go to "resolved" when the patch is applied, then "closed" when the version with the patch is released.  The means the list of "resolved" bugs is the ones we know about and have fixed but haven't yet made it into a release.

At least that's the theory.  We're not quite there yet.

As far as this one goes, we need someone who understands the x11 forwarding better than me to think about whether or not this is the right thing to do (and then render an opinion thereon :-).
Comment 7 Damien Miller 2011-09-06 10:34:18 AEST
Retarget unresolved bugs/features to 6.0 release
Comment 8 Damien Miller 2011-09-06 10:36:30 AEST
Retarget unresolved bugs/features to 6.0 release
Comment 9 Damien Miller 2011-09-06 10:39:05 AEST
Retarget unresolved bugs/features to 6.0 release

(try again - bugzilla's "change several" isn't)
Comment 10 Damien Miller 2012-02-24 10:34:26 AEDT
Retarget from 6.0 to 6.1
Comment 11 Damien Miller 2012-02-24 10:38:05 AEDT
Retarget 6.0 => 6.1
Comment 12 Damien Miller 2012-09-07 11:38:09 AEST
Retarget uncompleted bugs from 6.1 => 6.2
Comment 13 Damien Miller 2012-09-07 11:40:37 AEST
Retarget bugs from 6.1 => 6.2
Comment 14 Damien Miller 2013-03-08 10:23:51 AEDT
retarget to openssh-6.3
Comment 15 Damien Miller 2013-07-25 12:17:48 AEST
Retarget to openssh-6.4
Comment 16 Damien Miller 2013-07-25 12:20:44 AEST
Retarget 6.3 -> 6.4
Comment 17 Damien Miller 2014-02-06 10:17:58 AEDT
Retarget incomplete bugs / feature requests to 6.6 release
Comment 18 Damien Miller 2014-02-06 10:19:57 AEDT
Retarget incomplete bugs / feature requests to 6.6 release
Comment 19 Damien Miller 2014-04-12 14:49:33 AEST
Retarget to 6.7 release, since 6.6 was mostly bugfixing.
Comment 20 Damien Miller 2014-04-12 14:53:51 AEST
Remove from 6.6 tracking bug
Comment 21 Damien Miller 2014-08-30 04:37:58 AEST
Retarget incomplete bugs to 6.8 release.
Comment 22 Damien Miller 2014-08-30 04:39:42 AEST
These bugs are no longer targeted at the imminent 6.7 release
Comment 23 Damien Miller 2015-03-03 07:59:35 AEDT
OpenSSH 6.8 is approaching release and closed for major work. Retarget these bugs for the next release.
Comment 24 Damien Miller 2015-03-03 08:01:04 AEDT
Retarget to 6.9
Comment 25 Damien Miller 2015-08-11 22:59:08 AEST
Retarget pending bugs to openssh-7.1
Comment 26 Damien Miller 2016-02-26 14:44:25 AEDT
Retarget to openssh-7.3
Comment 27 Damien Miller 2016-02-26 14:47:20 AEDT
Retarget to openssh-7.3
Comment 28 Damien Miller 2016-07-22 14:10:53 AEST
retarget unfinished bugs to next release
Comment 29 Damien Miller 2016-07-22 14:14:44 AEST
retarget unfinished bugs to next release
Comment 30 Damien Miller 2016-07-22 14:15:47 AEST
retarget unfinished bugs to next release
Comment 31 Damien Miller 2016-07-22 14:17:18 AEST
retarget unfinished bugs to next release
Comment 32 Damien Miller 2016-12-16 14:31:27 AEDT
OpenSSH 7.4 release is closing; punt the bugs to 7.5
Comment 33 Damien Miller 2017-06-30 13:43:12 AEST
Move incomplete bugs to openssh-7.6 target since 7.5 shipped a while back.

To calibrate expectations, there's little chance all of these are going to make 7.6.
Comment 34 Damien Miller 2017-06-30 13:44:34 AEST
remove 7.5 target
Comment 35 Damien Miller 2017-08-25 14:56:04 AEST
Comment on attachment 1178 [details]
Set $DISPLAY to match what xauth ends up using

The alternate patch has rotted a bit (since IPv6-capable X11 is slightly more of a thing now) but even if it were renovated to use getnameinfo() I still think this better matches what X11 will use.
Comment 36 Damien Miller 2018-04-06 13:12:21 AEST
Move to OpenSSH 7.8 tracking bug
Comment 37 Damien Miller 2018-08-10 11:37:59 AEST
Retarget remaining bugs planned for 7.8 release to 7.9
Comment 38 Damien Miller 2018-08-10 11:38:24 AEST
Retarget remaining bugs planned for 7.8 release to 7.9
Comment 39 Damien Miller 2018-10-19 17:13:42 AEDT
Retarget unfinished bugs to OpenSSH 8.0
Comment 40 Damien Miller 2018-10-19 17:14:48 AEDT
Retarget unfinished bugs to OpenSSH 8.0
Comment 41 Damien Miller 2018-10-19 17:15:49 AEDT
Retarget unfinished bugs to OpenSSH 8.0
Comment 42 Damien Miller 2019-04-03 10:10:33 AEDT
Retarget outstanding bugs at next release
Comment 43 Damien Miller 2019-10-09 15:07:24 AEDT
Retarget these bugs to 8.2 release
Comment 44 Damien Miller 2020-02-04 11:44:24 AEDT
Prepare for 8.2 release; retarget bugs
Comment 45 Damien Miller 2020-05-08 13:39:18 AEST
Retarget bugs to 8.4 release
Comment 46 Damien Miller 2021-03-04 09:46:58 AEDT
retarget to 8.6
Comment 47 Damien Miller 2021-04-23 14:50:14 AEST
retarget after 8.6p1 release