*/smbclient: protect all libsmbclient calls with a mutex
libsmbclient is not thread-safe nor reentrant. We must protect all function calls with a global mutex, unfortunately.
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "SmbclientNeighborPlugin.hxx"
|
||||
#include "lib/smbclient/Init.hxx"
|
||||
#include "lib/smbclient/Domain.hxx"
|
||||
#include "lib/smbclient/Mutex.hxx"
|
||||
#include "neighbor/NeighborPlugin.hxx"
|
||||
#include "neighbor/Explorer.hxx"
|
||||
#include "neighbor/Listener.hxx"
|
||||
@@ -175,6 +176,7 @@ static NeighborExplorer::List
|
||||
DetectServers()
|
||||
{
|
||||
NeighborExplorer::List list;
|
||||
const ScopeLock protect(smbclient_mutex);
|
||||
ReadServers(list, "smb://");
|
||||
return list;
|
||||
}
|
||||
|
Reference in New Issue
Block a user