https://gitlab.synchro.net/main/sbbs/-/commit/346849ac253a08374b9bfca0
Modified Files:
src/sbbs3/main.cpp
Log Message:
Unlock ssh_mutex before calling sftps_recv()
This should fix the sftp hangs...
While FreeBSD will return EDEADLOCK when a mutex would deadlock,
Linux will do what I ask and deadlock.
Since we're not checking the return value of pthread_mutex_lock(),
this would go completely unnoticed on FreeBSD, resulting in the
mutex being unlocked early and all sorts of unprotected accesses
would happen, potentially doing crazy things. On Linux it just
deadlocks, and taking a peek at the thread backtraces makes the
problem obvious.
So, point to Linux for making life more correct for people who
do incorrect things (locking without checking the return value).
I'd also like to thank nelgin, for sticking with me on this issue
and being my gdb puppet.
And really, this commit should be shared by all the contributors
who... 𝆺𝅥𝅮𝆺𝅥𝅮𝆹𝅥𝅯𝆹𝅥𝅯
---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net