diff options
author | Volker Lendecke <vl@samba.org> | 2011-06-14 17:52:42 +0200 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2011-06-14 19:06:39 +0200 |
commit | df6b877cc2a868f0a05192f1c524831c177fa1cb (patch) | |
tree | 66f280c11698fe964fbf8ca3de7650ae454f4356 /source3/smbd | |
parent | 2817eed7412380116766a75718c90e635f6c93f4 (diff) | |
download | samba-df6b877cc2a868f0a05192f1c524831c177fa1cb.tar.gz samba-df6b877cc2a868f0a05192f1c524831c177fa1cb.tar.bz2 samba-df6b877cc2a868f0a05192f1c524831c177fa1cb.zip |
s3: Fix connecting to ctdb as non-root
This is at least one instance which I could identify
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Jun 14 19:06:39 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/connection.c | 7 |
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")); |