Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Execute Command doesnt work with dropbear #128
Since upgrading dropbear in my embedded target (to 2014.66) Executing Command or rather waiting for the Command Result leads to hanging in an endless loop in read_outputs in paramikos recv_exit_status() function. It seems that upon receiving dropbears EOF we never send a EOF which leads to the connection still being open. SSHLibraries _shell_open() function however makes us think the connection was teared down correctly.
I have tracked down the issue in dropbear to their changeset:
but I cant actually change that code in our target. (all other ssh connections do work without problems).
So below is a patch that fixes my problem by checking if exit_status_ready() will be successful before actually exexuting recv_exit_status(). In case it's not, the write direction is closed forcefully (which sends out the missing? EOF).
It works for me but I'm not sure if this is ok for everybody...? Any experts on this?
--- SSHLibrary.orig/src/SSHLibrary/pythonclient.py 2014-12-15 11:38:59.830379909 +0100
Hi mkj, thanks for looking into it. Here's a quick setup:
Create a file dropbear.txt:
Run it with (replace localhost with whatever your host is)
It'll hang after a few repetitions. If you end the test by killing the active dropbear thread on the other side you'll get a nice log.html, but it wont give you too much information. Maybe the ssh.log helps.
Am curious what you find...