Start a ControlMaster to some server like this: ssh -xo ControlMaster=yes -o ServerAliveInterval=1 -o ServerAliveCountMax=1 10.0.0.21 "while [ 1 ]; do sleep 10; done" Then start some other command through the ControlMaster like this: ssh -xo ControlMaster=no -o ServerAliveInterval=1 -o ServerAliveCountMax=1 10.0.0.21 "while [ 1 ]; do sleep 10; done" Now pull the plug on the server (10.0.0.21 in this case). Both clients quit after one second. However, the controlmaster client will exit with exit status 255 while the other client exits with exitv status 0. If I understand the man page correctly they should both have exited with exit status 255.
Created attachment 1229 [details] don't return success when master exits unexpectedly Thanks - this is a bug in ssh. It does not initialise its return value when acting as a ControlMaster client and the master process exits unexpecedly. The attached patch makes a control client return 255 when it does not receive an explicit return value from the master.
fix has been committed and will be in openssh-4.7 - thanks!
Close resolved bugs after release.