*/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:
Max Kellermann
2014-02-06 22:19:59 +01:00
parent a7989077ab
commit c8f0c7e9ed
7 changed files with 86 additions and 1 deletions

View File

@@ -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;
}