Bug 3589 - ControlMaster auto, persist and -f fail.
Summary: ControlMaster auto, persist and -f fail.
Status: RESOLVED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 9.3p1
Hardware: amd64 Linux
: P5 minor
Assignee: Damien Miller
URL:
Keywords:
Depends on:
Blocks: V_9_4
  Show dependency treegraph
 
Reported: 2023-07-19 11:57 AEST by Peter Chubb
Modified: 2023-07-28 08:33 AEST (History)
2 users (show)

See Also:


Attachments
ssh -v -f -X somehost xterm (5.55 KB, application/octet-stream)
2023-07-19 11:57 AEST, Peter Chubb
no flags Details
Possible fix. (580 bytes, patch)
2023-07-26 09:50 AEST, Peter Chubb
no flags Details | Diff
Fix -f in mux client mode (2.65 KB, patch)
2023-07-26 16:03 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 Peter Chubb 2023-07-19 11:57:33 AEST
Created attachment 3706 [details]
ssh -v -f -X somehost xterm

In my ~/.ssh/config I have:

Host *
     ControlMaster auto
     ControlPersist 300
     ControlPath /home/%u/.ssh/controlmaster/%h-%p-%r.sock
     ServerAliveInterval 60
     TCPKeepAlive yes

Doing:
  ssh -X -f somehost xterm

does not start an xterm the first time it is run.
Repeating the command does start an xterm.
Comment 1 Peter Chubb 2023-07-26 09:50:32 AEST
Created attachment 3708 [details]
Possible fix.
Comment 2 Damien Miller 2023-07-26 12:45:15 AEST
that seems to help insofar as xclock now runs, but it doesn't background properly. It's been a while since I've touched this code, but IIRC for ControlPersist the command should be run by the forked client of the mux process and I'm not convinced that's happening right in this case.
Comment 3 Peter Chubb 2023-07-26 12:48:20 AEST
For that you need the new patch I appended to https://bugzilla.mindrot.org/show_bug.cgi?id=1948
Comment 4 Peter Chubb 2023-07-26 12:51:15 AEST
https://bugzilla.mindrot.org/attachment.cgi?id=3705
Comment 5 Damien Miller 2023-07-26 16:03:35 AEST
Created attachment 3709 [details]
Fix -f in mux client mode
Comment 6 Peter Chubb 2023-07-27 20:46:20 AEST
Yay!  the latest patch seems to work (more consistently than my half-baked ones anyway)

Thanks!
Comment 7 Damien Miller 2023-07-28 08:33:09 AEST
Applied in 2d34205dab08e and will be in OpenSSH 9.4, due in a couple of weeks. Thanks!