#1069674 openssh-client: multiplexed connections use incorrect DISPLAY etc, but no TOKENS exist to modify the connection socket

Package:
openssh-client
Source:
openssh-client
Description:
secure shell (SSH) client, for secure access to remote machines
Submitter:
Tim Connors
Date:
2024-04-22 13:39:03 UTC
Severity:
normal
#1069674#5
Date:
2024-04-22 13:35:57 UTC
From:
To:
With .ssh/config:

    ControlMaster auto
    ControlPath ~/.ssh/cm_master/%r@%h:%p
    ControlPersist yes

Set up the mux master on host a to host c:
:0

xterm fires up on host a.  Kill that

Now, if we arrange for DISPLAY to point to another display (I sshed to
another host b, set DISPLAY=:0, verified xterm opened up on that host,
then sshed back to my original host a), and try to fire up ssh again:
localhost:11.0

xterm fires up on host a instead of host b, which was where $DISPLAY
was pointing.

OK, so the muxing protocol isn't smart enough to allow DISPLAY to be
dynamically set (a bit like bug #931187, ssh not properly acting as if
a new connection has been made and handing out /etc/motd properly).
So let's work around it by setting ControlPath according to what
DISPLAY is being asked for.  Hmmmf, there are no appropriate TOKENS.

Perhaps there should be a %D TOKEN value for $DISPLAY?  Or since I'm
sure there's other connection properties that shouldn't be shared
between multiplexed connections, can the protocol be modified to allow
DISPLAY and other values to be properly set per multiplexed
connection?