Skip to content
Snippets Groups Projects
Commit 64ce7cb9 authored by rswindell's avatar rswindell
Browse files

Fix race-condition causing SSH errors:

Terminal Server SSH ERROR 'Bad argument, parameter 1' (-1)
 ... from output_thread

The bbs_thread() sets the global/server sbbs ssh_mode to false and ssh_session
to 0 (the "parameter 1" value used in the cryptlib function calls in
output_thread) but was doing this without owning the ssh_mutex, so the
output_thread had a race condition where it would check ssh_mode=true and
then use grab the ssh_mutex and use ssh_session in a few cryptlib function
calls. The fix for the bbs_thread() to grab the ssh_mutex before setting
ssh_mode to false and ssh_session to 0 and have the output_thread() re-check
the ssh_mode after grabbing the ssh_mutex and not call any cryptlib
functions if ssh_mode was set to false while waiting for the mutex.

The cause would have been more obvious if the various cryptlib error/log
messages contained the cryptlib session ID value (which was 0 in this case).
parent 98298430
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment