[Bug 1349] New: race condition with ControlMaster=auto

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Sun Aug 5 04:18:17 EST 2007


           Summary: race condition with ControlMaster=auto
           Product: Portable OpenSSH
           Version: 4.6p1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ssh
        AssignedTo: bitbucket at mindrot.org
        ReportedBy: dot at dotat.at

Created an attachment (id=1335)
 --> (http://bugzilla.mindrot.org/attachment.cgi?id=1335)
Fix race in ControlMaster=auto

There is a race in the setup of the ControlMaster socket in auto mode,
as illustrated by the following command line:

ssh -oControlMaster=auto -oControlPath=sock localhost 'sleep 1; echo 1'
ssh -oControlMaster=auto -oControlPath=sock localhost 'sleep 2; echo 2'

Both of the commands will try to start up as a control client, find
that sock does not exist, and switch into control master mode. One will
succeed in creating the control master socket and the other will fail
and bomb.

The attached patch eliminates this race by trying to create a control
master socket first, and falling back to control client mode if master
mode fails.

Configure bugmail: http://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.

More information about the openssh-bugs mailing list