Dropbear 0.50 server returnsexit code 255 to ssh when app returns 0

roger at planbit.co.uk roger at planbit.co.uk
Fri Nov 30 23:52:35 WST 2007


Hi,

We are running the Dropbear 0.50 SSH server on an ARM9 platform.  We are
connecting to it from a fast quad-core intel server over 100-Base-T.

We found this problem when trying to build Perl for the target.  The
cross-compile process uploads and runs programs on the target and checks
the exit code from the SSH client to check the target program's exit code.

The ARM9 platform is running a stock Linux 2.6.18 kernel compiled with the
GCC CodeSourcery 2006q3-26 v4.1.1.

The host Intel platform is running CentOS5 with OpenSSH_4.3p2.

A sample shell script on the target is:

#!/bin/bash
echo "ARG: $1"
exit $1

When we run dropbear 0.50 server on the target without debug enabled, we
get exit code 255 from SSH.  e.g.

# ssh root at 192.168.0.10 /tmp/test.sh 1
ARG: 1
# echo $?
255
#

# ssh root at 192.168.0.10 /tmp/test.sh 100
ARG: 1
# echo $?
255
#

If we recompile dropbear with debug enabled, but don't pass the -v option
when starting dropbear, the behavior is the same.  If we run dropbear with
the "-F -E -v" options, we get the correct exit codes.

# ssh root at 192.168.0.10 /tmp/test.sh 1
TRACE: enter sign_key_free
TRACE: enter dsa_key_free
TRACE: enter dsa_key_free: key == NULL
TRACE: enter rsa_key_free
TRACE: leave rsa_key_free
TRACE: leave sign_key_free
ARG: 1
# echo $?
1
#

# ssh root at 192.168.0.10 /tmp/test.sh 100
TRACE: enter sign_key_free
TRACE: enter dsa_key_free
TRACE: enter dsa_key_free: key == NULL
TRACE: enter rsa_key_free
TRACE: leave rsa_key_free
TRACE: leave sign_key_free
ARG: 1
# echo $?
100
#

Does anyone have any ideas what could be causing this?

Has anyone seen this on other platforms or is happy that dropbear does
return the correct exit codes in their tests?

Thanks,

Roger




More information about the Dropbear mailing list