summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-09-18 18:27:16 +0200
committerVolker Lendecke <vl@samba.org>2009-09-18 18:32:25 +0200
commit30a4695b273613f8a62cf195a3764a923820f131 (patch)
treea0fb5ef8594ef0ebbefd9c7112b4328d2c5c97a4 /source3
parent89e80bfe4fdeddd371e7409ea0ed0b53d26650a4 (diff)
downloadsamba-30a4695b273613f8a62cf195a3764a923820f131.tar.gz
samba-30a4695b273613f8a62cf195a3764a923820f131.tar.bz2
samba-30a4695b273613f8a62cf195a3764a923820f131.zip
s3:smbstatus: Fix bug 6703, allow smbstatus as non-root
We only require a ctdb connection when clustering is enabled. This limits the restriction for only-root smbstatus to the clustering case.
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/status.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/source3/utils/status.c b/source3/utils/status.c
index f7a6155be2..6d616149d7 100644
--- a/source3/utils/status.c
+++ b/source3/utils/status.c
@@ -377,18 +377,20 @@ static int traverse_sessionid(struct db_record *db, void *state)
goto done;
}
- /*
- * This implicitly initializes the global ctdbd connection, usable by
- * the db_open() calls further down.
- */
- msg_ctx = messaging_init(NULL, procid_self(),
- event_context_init(NULL));
-
- if (msg_ctx == NULL) {
- fprintf(stderr, "messaging_init failed\n");
- ret = -1;
- goto done;
+ if (lp_clustering()) {
+ /*
+ * This implicitly initializes the global ctdbd
+ * connection, usable by the db_open() calls further
+ * down.
+ */
+ msg_ctx = messaging_init(NULL, procid_self(),
+ event_context_init(NULL));
+ if (msg_ctx == NULL) {
+ fprintf(stderr, "messaging_init failed\n");
+ ret = -1;
+ goto done;
+ }
}
if (!lp_load(get_dyn_CONFIGFILE(),False,False,False,True)) {