From c8f0c7e9ede1cfef49ea9d4b71b6b56b4ae87141 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 6 Feb 2014 22:19:59 +0100 Subject: */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. --- src/neighbor/plugins/SmbclientNeighborPlugin.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/neighbor/plugins/SmbclientNeighborPlugin.cxx') 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; } -- cgit v1.2.3