missing exitcode for remote commands.

Markus Friedl markus at openbsd.org
Thu Oct 11 01:17:51 EST 2001


it's easy to reproduce your problem:

ssh -n localhost 'echo x; exec > /dev/null 2>&1; sleep 3; exit 5;'

will always have an exit status of 255 (the default for the client)
instead of 5 because the sshd sends a CHANNEL CLOSE message (since
all pipes are closed) before the shell exits. so a "exit-status"
messages cannot be sent because the channel is gone at this point.

i'm not sure how to delay the CLOSE message.



More information about the openssh-unix-dev mailing list