1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-08 04:58:40 +03:00

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.
This commit is contained in:
Volker Lendecke 2009-09-18 18:27:16 +02:00
parent 89e80bfe4f
commit 30a4695b27

View File

@ -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)) {