From df6b877cc2a868f0a05192f1c524831c177fa1cb Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 14 Jun 2011 17:52:42 +0200 Subject: s3: Fix connecting to ctdb as non-root This is at least one instance which I could identify Autobuild-User: Volker Lendecke Autobuild-Date: Tue Jun 14 19:06:39 CEST 2011 on sn-devel-104 --- source3/smbd/connection.c | 7 +++++++ 1 file changed, 7 insertions(+) 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")); -- cgit