summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/connection.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c
index 08afd92f6e..f1ec301ee2 100644
--- a/source3/smbd/connection.c
+++ b/source3/smbd/connection.c
@@ -112,7 +112,14 @@ int count_current_connections( const char *sharename, bool clear )
* as it leads to deadlock.
*/
+ /*
+ * become_root() because we might have to open connections.tdb
+ * via ctdb, which is not possible without root.
+ */
+ become_root();
ret = connections_forall(count_fn, &cs);
+ unbecome_root();
+
if (ret == -1) {
DEBUG(0,("count_current_connections: traverse of "
"connections.tdb failed\n"));