aboutsummaryrefslogtreecommitdiffstats
path: root/src/neighbor
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-06 22:19:59 +0100
committerMax Kellermann <max@duempel.org>2014-02-06 22:19:59 +0100
commitc8f0c7e9ede1cfef49ea9d4b71b6b56b4ae87141 (patch)
tree85adef73380393703c71202f20601d99df135b00 /src/neighbor
parenta7989077abe2b862b131b7573380a82f889bad95 (diff)
downloadmpd-c8f0c7e9ede1cfef49ea9d4b71b6b56b4ae87141.tar.gz
mpd-c8f0c7e9ede1cfef49ea9d4b71b6b56b4ae87141.tar.xz
mpd-c8f0c7e9ede1cfef49ea9d4b71b6b56b4ae87141.zip
*/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.
Diffstat (limited to 'src/neighbor')
-rw-r--r--src/neighbor/plugins/SmbclientNeighborPlugin.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/neighbor/plugins/SmbclientNeighborPlugin.cxx b/src/neighbor/plugins/SmbclientNeighborPlugin.cxx
index 2b81f3ceb..2701b0ccd 100644
--- a/src/neighbor/plugins/SmbclientNeighborPlugin.cxx
+++ b/src/neighbor/plugins/SmbclientNeighborPlugin.cxx
@@ -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;
}