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') 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') 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 From 77afcad8f09b50977f4b88b68d66ebd61b7ffa82 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 18 Sep 2009 20:20:07 +0200 Subject: s3: Fix Coverity ID 581 -- NEGATIVE_RETURNS --- source3/lib/dprintf.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3') diff --git a/source3/lib/dprintf.c b/source3/lib/dprintf.c index 631c45a807..835d34076e 100644 --- a/source3/lib/dprintf.c +++ b/source3/lib/dprintf.c @@ -66,6 +66,10 @@ again: } clen = convert_string(CH_UNIX, CH_DISPLAY, p, ret, p2, maxlen, True); + if (clen == -1) { + ret = -1; + goto out; + } if (clen >= maxlen) { /* it didn't fit - try a larger buffer */ -- cgit From 700df9b27a0623336c1ad78414be9fd572fd2e56 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 18 Sep 2009 21:27:55 +0200 Subject: s3-smbd: fix get_ea_names_from_file() and check for pnames pointer. This fixes smbd from crashing all the time. Jeremy, Volker, please check. Guenther --- source3/smbd/trans2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 85eb73749a..ce458126d3 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -156,7 +156,9 @@ NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx, connection_struct *conn, ssize_t sizeret = -1; if (!lp_ea_support(SNUM(conn))) { - *pnames = NULL; + if (pnames) { + *pnames = NULL; + } *pnum_names = 0; return NT_STATUS_OK; } -- cgit From a4b5c792c55ef90648a528d279beec32f86a9b22 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 17 Sep 2009 09:42:49 +0200 Subject: s3-rpc_client: fix non initialized structure in rpccli_lsa_lookup_sids_noalloc. Guenther --- source3/rpc_client/cli_lsarpc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3') diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c index aa883d3cf1..d49fa47f57 100644 --- a/source3/rpc_client/cli_lsarpc.c +++ b/source3/rpc_client/cli_lsarpc.c @@ -152,6 +152,8 @@ static NTSTATUS rpccli_lsa_lookup_sids_noalloc(struct rpc_pipe_client *cli, struct lsa_TransNameArray2 lsa_names2; uint32_t n; + ZERO_STRUCT(lsa_names2); + result = rpccli_lsa_LookupSids3(cli, mem_ctx, &sid_array, &ref_domains, -- cgit