1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-10 04:23:50 +03:00

more fixes from the IRIX compiler (thanks herb!)

This commit is contained in:
Andrew Tridgell
-
parent de7674ebef
commit 4cf3839b72
41 changed files with 43 additions and 47 deletions

View File

@@ -2896,7 +2896,7 @@ static void remember_query_host(const char *arg,
*query_host = 0; *query_host = 0;
*base_directory = 0; *base_directory = 0;
setup_logging(argv[0],True); setup_logging(argv[0],DEBUG_STDOUT);
mem_ctx = talloc_init("client.c/main"); mem_ctx = talloc_init("client.c/main");
if (!mem_ctx) { if (!mem_ctx) {
d_printf("\nclient.c: Not enough memory\n"); d_printf("\nclient.c: Not enough memory\n");

View File

@@ -396,7 +396,7 @@ static void send_fs_socket(char *the_service, char *mount_point, struct cli_stat
/* here we are no longer interactive */ /* here we are no longer interactive */
set_remote_machine_name("smbmount"); /* sneaky ... */ set_remote_machine_name("smbmount"); /* sneaky ... */
setup_logging("mount.smbfs", False); setup_logging("mount.smbfs", DEBUG_STDERR);
reopen_logs(); reopen_logs();
DEBUG(0, ("mount.smbfs: entering daemon mode for service %s, pid=%d\n", the_service, sys_getpid())); DEBUG(0, ("mount.smbfs: entering daemon mode for service %s, pid=%d\n", the_service, sys_getpid()));
@@ -857,7 +857,7 @@ static void parse_mount_smb(int argc, char **argv)
DEBUGLEVEL = 1; DEBUGLEVEL = 1;
/* here we are interactive, even if run from autofs */ /* here we are interactive, even if run from autofs */
setup_logging("mount.smbfs",True); setup_logging("mount.smbfs",DEBUG_STDERR);
#if 0 /* JRA - Urban says not needed ? */ #if 0 /* JRA - Urban says not needed ? */
/* CLI_FORCE_ASCII=false makes smbmount negotiate unicode. The default /* CLI_FORCE_ASCII=false makes smbmount negotiate unicode. The default

View File

@@ -182,7 +182,7 @@ static int smb_print(struct cli_state *, char *, FILE *);
* Setup the SAMBA server state... * Setup the SAMBA server state...
*/ */
setup_logging("smbspool", True); setup_logging("smbspool", DEBUG_STDOUT);
in_client = True; /* Make sure that we tell lp_load we are */ in_client = True; /* Make sure that we tell lp_load we are */

View File

@@ -34,11 +34,11 @@ static BOOL cli_link_internal(struct cli_state *cli,
NTSTATUS status; NTSTATUS status;
if (hard_link) { if (hard_link) {
parms.generic.level = SMB_SFILEINFO_UNIX_HLINK; parms.generic.level = RAW_SFILEINFO_UNIX_HLINK;
parms.unix_hlink.file.fname = fname_src; parms.unix_hlink.file.fname = fname_src;
parms.unix_hlink.in.link_dest = fname_dst; parms.unix_hlink.in.link_dest = fname_dst;
} else { } else {
parms.generic.level = SMB_SFILEINFO_UNIX_LINK; parms.generic.level = RAW_SFILEINFO_UNIX_LINK;
parms.unix_link.file.fname = fname_src; parms.unix_link.file.fname = fname_src;
parms.unix_link.in.link_dest = fname_dst; parms.unix_link.in.link_dest = fname_dst;
} }

View File

@@ -94,7 +94,7 @@ int cli_list_new(struct cli_state *cli, const char *Mask, uint16 attribute,
char *mask; char *mask;
int ff_eos = 0, i, ff_searchcount; int ff_eos = 0, i, ff_searchcount;
int ff_dir_handle=0; int ff_dir_handle=0;
int level; enum search_level level;
/* initialize state for search */ /* initialize state for search */
state.dirlist = NULL; state.dirlist = NULL;

View File

@@ -121,7 +121,6 @@ NTSTATUS smb_tree_connect_recv(struct cli_request *req, TALLOC_CTX *mem_ctx, uni
case RAW_TCON_TCONX: case RAW_TCON_TCONX:
ZERO_STRUCT(parms->tconx.out); ZERO_STRUCT(parms->tconx.out);
CLI_CHECK_MIN_WCT(req, 0); /* this depends on the protocol level */
parms->tconx.out.cnum = SVAL(req->in.hdr, HDR_TID); parms->tconx.out.cnum = SVAL(req->in.hdr, HDR_TID);
if (req->in.wct >= 4) { if (req->in.wct >= 4) {
parms->tconx.out.options = SVAL(req->in.vwv, VWV(3)); parms->tconx.out.options = SVAL(req->in.vwv, VWV(3));
@@ -245,7 +244,6 @@ NTSTATUS cli_tree_full_connection(struct cli_tree **ret_tree,
mem_ctx = talloc_init("tcon"); mem_ctx = talloc_init("tcon");
if (!mem_ctx) { if (!mem_ctx) {
cli_tree_close(tree);
return NT_STATUS_NO_MEMORY; return NT_STATUS_NO_MEMORY;
} }

View File

@@ -146,7 +146,6 @@ static NTSTATUS smb_raw_info_backend(struct cli_session *session,
case RAW_FILEINFO_STREAM_INFO: case RAW_FILEINFO_STREAM_INFO:
case RAW_FILEINFO_STREAM_INFORMATION: case RAW_FILEINFO_STREAM_INFORMATION:
FINFO_CHECK_MIN_SIZE(0);
ofs = 0; ofs = 0;
parms->stream_info.out.num_streams = 0; parms->stream_info.out.num_streams = 0;
parms->stream_info.out.streams = NULL; parms->stream_info.out.streams = NULL;
@@ -228,7 +227,6 @@ static NTSTATUS smb_raw_info_backend(struct cli_session *session,
return NT_STATUS_OK; return NT_STATUS_OK;
case RAW_FILEINFO_UNIX_LINK: case RAW_FILEINFO_UNIX_LINK:
FINFO_CHECK_MIN_SIZE(0);
cli_blob_pull_string(session, mem_ctx, blob, cli_blob_pull_string(session, mem_ctx, blob,
&parms->unix_link_info.out.link_dest, 0, 4, STR_UNICODE); &parms->unix_link_info.out.link_dest, 0, 4, STR_UNICODE);
return NT_STATUS_OK; return NT_STATUS_OK;

View File

@@ -22,7 +22,7 @@
#include "includes.h" #include "includes.h"
static const struct { static const struct {
int prot; enum protocol_types prot;
const char *name; const char *name;
} prots[] = { } prots[] = {
{PROTOCOL_CORE,"PC NETWORK PROGRAM 1.0"}, {PROTOCOL_CORE,"PC NETWORK PROGRAM 1.0"},

View File

@@ -658,7 +658,7 @@ static BOOL open_sockets(BOOL isdaemon, int port)
exit(1); exit(1);
} }
setup_logging( argv[0], log_stdout ); setup_logging( argv[0], log_stdout?DEBUG_STDOUT : DEBUG_FILE );
reopen_logs(); reopen_logs();

View File

@@ -892,7 +892,7 @@ static void usage(void)
snprintf(logfile, sizeof(logfile), "%s/log.winbindd", dyn_LOGFILEBASE); snprintf(logfile, sizeof(logfile), "%s/log.winbindd", dyn_LOGFILEBASE);
lp_set_logfile(logfile); lp_set_logfile(logfile);
setup_logging("winbindd", log_stdout); setup_logging("winbindd", log_stdout?DEBUG_STDOUT:DEBUG_FILE);
reopen_logs(); reopen_logs();
DEBUG(1, ("winbindd version %s started.\n", VERSION ) ); DEBUG(1, ("winbindd version %s started.\n", VERSION ) );

View File

@@ -79,7 +79,7 @@ static void nss_wins_init(void)
AllowDebugChange = False; AllowDebugChange = False;
TimeInit(); TimeInit();
setup_logging("nss_wins",False); setup_logging("nss_wins",DEBUG_FILE);
lp_load(dyn_CONFIGFILE,True,False,False); lp_load(dyn_CONFIGFILE,True,False,False);
load_interfaces(); load_interfaces();
} }

View File

@@ -51,7 +51,7 @@ int pam_sm_acct_mgmt( pam_handle_t *pamh, int flags,
extern BOOL in_client; extern BOOL in_client;
/* Samba initialization. */ /* Samba initialization. */
setup_logging( "pam_smbpass", False ); setup_logging( "pam_smbpass", DEBUG_FILE);
in_client = True; in_client = True;
ctrl = set_ctrl( flags, argc, argv ); ctrl = set_ctrl( flags, argc, argv );

View File

@@ -72,7 +72,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
/* Samba initialization. */ /* Samba initialization. */
setup_logging("pam_smbpass",False); setup_logging("pam_smbpass",DEBUG_FILE);
in_client = True; in_client = True;
ctrl = set_ctrl(flags, argc, argv); ctrl = set_ctrl(flags, argc, argv);

View File

@@ -99,7 +99,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
NTSTATUS nt_status; NTSTATUS nt_status;
/* Samba initialization. */ /* Samba initialization. */
setup_logging( "pam_smbpass", False ); setup_logging( "pam_smbpass", DEBUG_FILE );
in_client = True; in_client = True;
ctrl = set_ctrl(flags, argc, argv); ctrl = set_ctrl(flags, argc, argv);

View File

@@ -104,11 +104,11 @@ PyObject *py_setup_logging(PyObject *self, PyObject *args, PyObject *kw)
} }
if (interactive) if (interactive)
setup_logging("spoolss", True); setup_logging("spoolss", DEBUG_STDOUT);
if (logfilename) { if (logfilename) {
lp_set_logfile(logfilename); lp_set_logfile(logfilename);
setup_logging(logfilename, False); setup_logging(logfilename, DEBUG_FILE );
reopen_logs(); reopen_logs();
} }

View File

@@ -463,6 +463,6 @@ void initlsa(void)
py_samba_init(); py_samba_init();
setup_logging("lsa", True); setup_logging("lsa", DEBUG_STDOUT);
DEBUGLEVEL = 10; DEBUGLEVEL = 10;
} }

View File

@@ -492,6 +492,6 @@ void initsamr(void)
py_samba_init(); py_samba_init();
setup_logging("samr", True); setup_logging("samr", DEBUG_STDOUT);
DEBUGLEVEL = 10; DEBUGLEVEL = 10;
} }

View File

@@ -394,6 +394,6 @@ void initsmb(void)
py_samba_init(); py_samba_init();
setup_logging("smb", True); setup_logging("smb", DEBUG_STDOUT);
DEBUGLEVEL = 10; DEBUGLEVEL = 10;
} }

View File

@@ -259,7 +259,7 @@ static void setup_process_model(struct event_context *events,
DEBUG(0,("ERROR: Can't log to stdout (-S) unless daemon is in foreground (-F) or interactive (-i)\n")); DEBUG(0,("ERROR: Can't log to stdout (-S) unless daemon is in foreground (-F) or interactive (-i)\n"));
exit(1); exit(1);
} }
setup_logging(argv[0], log_stdout); setup_logging(argv[0], log_stdout?DEBUG_STDOUT:DEBUG_FILE);
fault_setup((void (*)(void *))exit_server); fault_setup((void (*)(void *))exit_server);

View File

@@ -55,7 +55,7 @@ void smbw_init(void)
smbw_busy++; smbw_busy++;
DEBUGLEVEL = 0; DEBUGLEVEL = 0;
setup_logging("smbsh",True); setup_logging("smbsh", DEBUG_STDOUT);
dbf = x_stderr; dbf = x_stderr;

View File

@@ -2113,7 +2113,7 @@ static void usage(void)
exit(1); exit(1);
} }
setup_logging(argv[0],True); setup_logging(argv[0], DEBUG_STDOUT);
for (i=0;i<NSERVERS;i++) { for (i=0;i<NSERVERS;i++) {
const char *share = argv[1+i]; const char *share = argv[1+i];
@@ -2147,7 +2147,7 @@ static void usage(void)
break; break;
case 'd': case 'd':
DEBUGLEVEL = atoi(optarg); DEBUGLEVEL = atoi(optarg);
setup_logging(NULL,True); setup_logging(NULL, DEBUG_STDOUT);
break; break;
case 's': case 's':
options.seed = atoi(optarg); options.seed = atoi(optarg);

View File

@@ -465,7 +465,7 @@ static void usage(void)
exit(1); exit(1);
} }
setup_logging(argv[0],True); setup_logging(argv[0], DEBUG_STDOUT);
for (server=0;server<NSERVERS;server++) { for (server=0;server<NSERVERS;server++) {
share[server] = argv[1+server]; share[server] = argv[1+server];

View File

@@ -493,7 +493,7 @@ static void usage(void)
all_string_sub(share1,"/","\\",0); all_string_sub(share1,"/","\\",0);
all_string_sub(share2,"/","\\",0); all_string_sub(share2,"/","\\",0);
setup_logging(argv[0],True); setup_logging(argv[0], DEBUG_STDOUT);
argc -= 4; argc -= 4;
argv += 4; argv += 4;

View File

@@ -380,7 +380,7 @@ static void usage(void)
all_string_sub(share,"/","\\",0); all_string_sub(share,"/","\\",0);
setup_logging(argv[0],True); setup_logging(argv[0], DEBUG_STDOUT);
argc -= 1; argc -= 1;
argv += 1; argv += 1;

View File

@@ -39,7 +39,7 @@ void pong_message(int msg_type, pid_t src, void *buf, size_t len)
int i, n; int i, n;
char buf[12]; char buf[12];
setup_logging(argv[0],True); setup_logging(argv[0], DEBUG_STDOUT);
lp_load(dyn_CONFIGFILE,False,False,False); lp_load(dyn_CONFIGFILE,False,False,False);

View File

@@ -282,7 +282,7 @@ enum client_action
smb_cli->nt_pipe_fnum = 0xffff; smb_cli->nt_pipe_fnum = 0xffff;
setup_logging(pname, True); setup_logging(pname, DEBUG_STDOUT);
password[0] = 0; password[0] = 0;

View File

@@ -4113,7 +4113,7 @@ static void usage(void)
break; break;
case 'd': case 'd':
lp_set_cmdline("debug level", optarg); lp_set_cmdline("debug level", optarg);
setup_logging(NULL,True); setup_logging(NULL, DEBUG_STDOUT);
break; break;
case 'O': case 'O':
lp_set_cmdline("socket options", optarg); lp_set_cmdline("socket options", optarg);

View File

@@ -222,7 +222,7 @@ int main(int argc,char *argv[])
*lookup = 0; *lookup = 0;
setup_logging(argv[0],True); setup_logging(argv[0], DEBUG_STDOUT);
while ((opt = getopt(argc, argv, "d:fB:U:i:s:SMrhART")) != EOF) while ((opt = getopt(argc, argv, "d:fB:U:i:s:SMrhART")) != EOF)
switch (opt) switch (opt)

View File

@@ -513,7 +513,7 @@ int main (int argc, char **argv)
{0,0,0,0} {0,0,0,0}
}; };
setup_logging("pdbedit", True); setup_logging("pdbedit", DEBUG_STDOUT);
pc = poptGetContext(NULL, argc, (const char **) argv, long_options, pc = poptGetContext(NULL, argc, (const char **) argv, long_options,
POPT_CONTEXT_KEEP_FIRST); POPT_CONTEXT_KEEP_FIRST);

View File

@@ -35,7 +35,7 @@ main()
ZERO_STRUCT(rpc_stub); ZERO_STRUCT(rpc_stub);
setup_logging("", True); setup_logging("", DEBUG_STDOUT);
DEBUGLEVEL=10; DEBUGLEVEL=10;
ctx=talloc_init("main"); ctx=talloc_init("main");

View File

@@ -789,7 +789,7 @@ You can string acls together with spaces, commas or newlines\n\
exit(EXIT_PARSE_ERROR); exit(EXIT_PARSE_ERROR);
} }
setup_logging(argv[0],True); setup_logging(argv[0], DEBUG_STDOUT);
share = argv[1]; share = argv[1];
pstrcpy(filename, argv[2]); pstrcpy(filename, argv[2]);

View File

@@ -656,7 +656,7 @@ static BOOL do_command(char *dest, char *msg_name, int iparams, char **params)
AllowDebugChange = False; AllowDebugChange = False;
DEBUGLEVEL = 0; DEBUGLEVEL = 0;
setup_logging(argv[0],True); setup_logging(argv[0], DEBUG_STDOUT);
if (argc < 2) usage(True); if (argc < 2) usage(True);

View File

@@ -222,7 +222,7 @@ int main(int argc, char *argv[])
char *desthost; char *desthost;
pstring configfile; pstring configfile;
setup_logging(argv[0],True); setup_logging(argv[0], DEBUG_STDOUT);
pstrcpy(configfile,dyn_CONFIGFILE); pstrcpy(configfile,dyn_CONFIGFILE);

View File

@@ -271,7 +271,7 @@ int main (int argc, char **argv)
enum SID_NAME_USE sid_type; enum SID_NAME_USE sid_type;
uint32 rid = -1; uint32 rid = -1;
setup_logging("groupedit", True); setup_logging("groupedit", DEBUG_STDOUT);
if (argc < 2) { if (argc < 2) {
usage(); usage();

View File

@@ -580,7 +580,7 @@ int main(int argc, char **argv)
local_flags = process_options(argc, argv, local_flags); local_flags = process_options(argc, argv, local_flags);
setup_logging("smbpasswd", True); setup_logging("smbpasswd", DEBUG_STDOUT);
/* /*
* Set the machine NETBIOS name if not already * Set the machine NETBIOS name if not already

View File

@@ -281,7 +281,7 @@ static BOOL print_tree(struct user_auth_info *user_info)
dbf = x_stderr; dbf = x_stderr;
setup_logging(argv[0],True); setup_logging(argv[0], DEBUG_STDOUT);
lp_load(dyn_CONFIGFILE,True,False,False); lp_load(dyn_CONFIGFILE,True,False,False);
load_interfaces(); load_interfaces();

View File

@@ -567,7 +567,7 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
POPT_TABLEEND POPT_TABLEEND
}; };
setup_logging(argv[0],True); setup_logging(argv[0], DEBUG_STDOUT);
dbf = x_stderr; dbf = x_stderr;

View File

@@ -218,7 +218,7 @@ int main(int argc, const char *argv[])
while((opt = poptGetNextOpt(pc)) != -1); while((opt = poptGetNextOpt(pc)) != -1);
setup_logging(poptGetArg(pc), True); setup_logging(poptGetArg(pc), DEBUG_STDOUT);
if (poptPeekArg(pc)) if (poptPeekArg(pc))
config_file = poptGetArg(pc); config_file = poptGetArg(pc);

View File

@@ -36,7 +36,7 @@ int main(int argc, char *argv[])
{ {
const char *pszTemp; const char *pszTemp;
setup_logging(argv[0],True); setup_logging(argv[0], DEBUG_STDOUT);
if (argc < 2 || argc > 3) if (argc < 2 || argc > 3)
printf("Usage: testprns printername [printcapfile]\n"); printf("Usage: testprns printername [printcapfile]\n");

View File

@@ -1286,7 +1286,7 @@ static void printers_page(void)
} }
} }
setup_logging(argv[0],False); setup_logging(argv[0],DEBUG_FILE);
load_config(True); load_config(True);
iNumNonAutoPrintServices = lp_numservices(); iNumNonAutoPrintServices = lp_numservices();
load_printers(); load_printers();

View File

@@ -619,7 +619,7 @@ static void process(void)
set_remote_machine_name("wrepld"); set_remote_machine_name("wrepld");
setup_logging(argv[0],log_stdout); setup_logging(argv[0],log_stdout?DEBUG_STDOUT:DEBUG_FILE);
/* we want to re-seed early to prevent time delays causing /* we want to re-seed early to prevent time delays causing
client problems at a later date. (tridge) */ client problems at a later date. (tridge) */