[SCM] Samba Shared Repository - branch master updated - tevent-0-9-8-437-g30a4695

Volker Lendecke vlendec at samba.org
Fri Sep 18 10:33:10 MDT 2009


The branch, master has been updated
       via  30a4695b273613f8a62cf195a3764a923820f131 (commit)
       via  89e80bfe4fdeddd371e7409ea0ed0b53d26650a4 (commit)
      from  ac3b58b85149134f2dd3c9c48a3a697f3bdf121a (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 30a4695b273613f8a62cf195a3764a923820f131
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Sep 18 18:27:16 2009 +0200

    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.

commit 89e80bfe4fdeddd371e7409ea0ed0b53d26650a4
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Sep 18 18:10:54 2009 +0200

    s3:smbstatus: Fix some nonempty blank lines

-----------------------------------------------------------------------

Summary of changes:
 source3/utils/status.c |   62 ++++++++++++++++++++++++-----------------------
 1 files changed, 32 insertions(+), 30 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/utils/status.c b/source3/utils/status.c
index fa7d1eb..6d61614 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 <http://www.gnu.org/licenses/>.
 
@@ -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<Ucrit_MaxPid;i++) {
 		if (cluster_id_equal(&pid, &Ucrit_pid[i])) 
 			return 1;
 	}
-	
+
 	return 0;
 }
 
@@ -96,7 +96,7 @@ static bool Ucrit_addPid( struct server_id pid )
 	}
 
 	Ucrit_pid[Ucrit_MaxPid++] = pid;
-	
+
 	return True;
 }
 
@@ -276,7 +276,7 @@ static int traverse_sessionid(struct db_record *db, void *state)
 		 numeric_only ? uid_str : uidtoname(sessionid.uid),
 		 numeric_only ? gid_str : gidtoname(sessionid.gid), 
 		 sessionid.remote_machine, sessionid.hostname);
-	
+
 	return 0;
 }
 
@@ -312,9 +312,9 @@ static int traverse_sessionid(struct db_record *db, void *state)
 	load_case_tables();
 
 	setup_logging(argv[0],True);
-	
+
 	dbf = x_stderr;
-	
+
 	if (getuid() != geteuid()) {
 		d_printf("smbstatus should not be run setuid\n");
 		ret = 1;
@@ -323,7 +323,7 @@ static int traverse_sessionid(struct db_record *db, void *state)
 
 	pc = poptGetContext(NULL, argc, (const char **) argv, long_options, 
 			    POPT_CONTEXT_KEEP_FIRST);
-	
+
 	while ((c = poptGetNextOpt(pc)) != -1) {
 		switch (c) {
 		case 'p':
@@ -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)) {
@@ -432,7 +434,7 @@ static int traverse_sessionid(struct db_record *db, void *state)
 			goto done;
 		}
 	}
-  
+
 	if ( show_shares ) {
 		if (verbose) {
 			d_printf("Opened %s\n", lock_path("connections.tdb"));
@@ -441,10 +443,10 @@ static int traverse_sessionid(struct db_record *db, void *state)
 		if (brief) {
 			goto done;
 		}
-		
+
 		d_printf("\nService      pid     machine       Connected at\n");
 		d_printf("-------------------------------------------------------\n");
-	
+
 		connections_forall(traverse_fn1, NULL);
 
 		d_printf("\n");
@@ -475,7 +477,7 @@ static int traverse_sessionid(struct db_record *db, void *state)
 			ret = 1;
 			goto done;
 		}
-		
+
 		result = share_mode_forall(print_share_mode, NULL);
 
 		if (result == 0) {
@@ -483,13 +485,13 @@ static int traverse_sessionid(struct db_record *db, void *state)
 		} else if (result == -1) {
 			d_printf("locked file list truncated\n");
 		}
-		
+
 		d_printf("\n");
 
 		if (show_brl) {
 			brl_forall(print_brl, NULL);
 		}
-		
+
 		locking_end();
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list