Bug 1261 - Timed out command through ControlMaster yields 0 return value.
Summary: Timed out command through ControlMaster yields 0 return value.
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 4.4p1
Hardware: ix86 Linux
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_4_7
  Show dependency treegraph
 
Reported: 2006-11-13 21:32 AEDT by Frederik Holljen
Modified: 2023-01-13 13:57 AEDT (History)
1 user (show)

See Also:


Attachments
don't return success when master exits unexpectedly (1.23 KB, patch)
2007-01-22 13:45 AEDT, Damien Miller
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frederik Holljen 2006-11-13 21:32:52 AEDT
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.
Comment 1 Damien Miller 2007-01-22 13:45:13 AEDT
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.
Comment 2 Damien Miller 2007-06-12 21:11:29 AEST
fix has been committed and will be in openssh-4.7 - thanks!
Comment 3 Damien Miller 2008-04-04 09:57:16 AEDT
Close resolved bugs after release.