Strange behaviour surrounding "ssh -T ..." and non-zero exit

Matt Johnston matt at ucc.asn.au
Fri Nov 9 22:28:54 AWST 2018


Hi Michael,

On 2018-11-09 3:48 pm, W. Michael Petullo wrote:
>> I am using Dropbear v2017.75 as found on OpenWrt.
>> 
>> echo input | ssh -T h; echo $?
>> 
>> Despite the error occurring, the above command line prints `0' rather
>> than `1.' Since this triggers the error, I would expect the latter
>> instead.
> 
> After looking at the code, it appears this block in common-channel.c is
> the culprit (line 346):

> I think ssh is reaching the EOF on stdin, and then this block causes 
> the
> channel to close before it reads the exit code from the distant end.

I think this problem might be fixed in v2018.76, 
https://secure.ucc.asn.au/hg/dropbear/rev/0c16b4ccbd54#l4.46 <https://secure.ucc.asn.au/hg/dropbear/rev/0c16b4ccbd54#l4.46>
Now the exit code check happens before the line you noted. Somehow that 
got missed in CHANGES.

Cheers,
Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ucc.gu.uwa.edu.au/pipermail/dropbear/attachments/20181109/966eadb7/attachment.htm 


More information about the Dropbear mailing list