From 89e80bfe4fdeddd371e7409ea0ed0b53d26650a4 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 18 Sep 2009 18:10:54 +0200 Subject: s3:smbstatus: Fix some nonempty blank lines --- source3/utils/status.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/status.c b/source3/utils/status.c index fa7d1eba2b..f7a6155be2 100644 --- a/source3/utils/status.c +++ b/source3/utils/status.c @@ -2,17 +2,17 @@ Unix SMB/CIFS implementation. status reporting Copyright (C) Andrew Tridgell 1994-1998 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . @@ -61,25 +61,25 @@ static unsigned int Ucrit_checkUid(uid_t uid) { if ( !Ucrit_IsActive ) return 1; - + if ( uid == Ucrit_uid ) return 1; - + return 0; } static unsigned int Ucrit_checkPid(struct server_id pid) { int i; - + if ( !Ucrit_IsActive ) return 1; - + for (i=0;i Date: Fri, 18 Sep 2009 18:27:16 +0200 Subject: 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. --- source3/utils/status.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'source3/utils') 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)) { -- cgit