diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-09-18 14:12:02 -0700 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-09-18 14:12:02 -0700 |
commit | 716ddc2a897eacd08aed7ff4bee165e418ff63cc (patch) | |
tree | 9f400d977baa55edc70fa39e1346fb2dda975a27 /source3 | |
parent | c6d58efa4b1ad5ff4a9e0f224b8a9789d8f82faf (diff) | |
parent | c2139e8e5646a8558d70c1ca4ce2d755497de8e1 (diff) | |
download | samba-716ddc2a897eacd08aed7ff4bee165e418ff63cc.tar.gz samba-716ddc2a897eacd08aed7ff4bee165e418ff63cc.tar.bz2 samba-716ddc2a897eacd08aed7ff4bee165e418ff63cc.zip |
Merge branch 'master' of /home/tridge/samba/git/combined
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/dprintf.c | 4 | ||||
-rw-r--r-- | source3/rpc_client/cli_lsarpc.c | 2 | ||||
-rw-r--r-- | source3/smbd/trans2.c | 4 | ||||
-rw-r--r-- | source3/utils/status.c | 62 |
4 files changed, 41 insertions, 31 deletions
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 */ 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, 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; } diff --git a/source3/utils/status.c b/source3/utils/status.c index fa7d1eba2b..6d616149d7 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(); } |