--- nagios-3.0.6/base/checks.c.p11 2008-12-01 03:22:58 +1000 +++ nagios-3.0.6/base/checks.c 2009-01-12 10:19:29 +1000 @@ -134,7 +134,7 @@ int reap_check_results(void){ check_result *queued_check_result=NULL; service *temp_service=NULL; host *temp_host=NULL; - char *temp_buffer=NULL; + /* char *temp_buffer=NULL; */ time_t current_time=0L; time_t reaper_start_time=0L; int reaped_checks=0; @@ -330,7 +330,7 @@ int run_async_service_check(service *svc char *output_file=NULL; double old_latency=0.0; dbuf checkresult_dbuf; - int dbuf_chunk=1024; + int dbuf_chunk=1024,tmp; #ifdef USE_EVENT_BROKER int neb_result=OK; #endif @@ -338,8 +338,8 @@ int run_async_service_check(service *svc char fname[512]=""; char *args[5]={"",DO_CLEAN, "", "", NULL }; char *perl_plugin_output=NULL; - SV *plugin_hndlr_cr; - STRLEN n_a ; + SV *plugin_hndlr_cr=NULL; + /* STRLEN n_a ; */ int count ; int use_epn=FALSE; #ifdef aTHX @@ -463,7 +463,7 @@ int run_async_service_check(service *svc /* open a temp file for storing check output */ old_umask=umask(new_umask); - asprintf(&output_file,"%s/checkXXXXXX",temp_path); + tmp=asprintf(&output_file,"%s/checkXXXXXX",temp_path); check_result_info.output_file_fd=mkstemp(output_file); if(check_result_info.output_file_fd>0) check_result_info.output_file_fp=fdopen(check_result_info.output_file_fd,"w"); @@ -607,7 +607,7 @@ int run_async_service_check(service *svc /* free check result memory */ free_check_result(&check_result_info); - return; + return OK; } else{ @@ -901,7 +901,7 @@ int handle_async_service_check_result(se int state_changes_use_cached_state=TRUE; /* TODO - 09/23/07 move this to a global variable */ int flapping_check_done=FALSE; void *ptr=NULL; - + int tmp; log_debug_info(DEBUGL_FUNCTIONS,0,"handle_async_service_check_result()\n"); @@ -996,9 +996,9 @@ int handle_async_service_check_result(se logit(NSLOG_RUNTIME_WARNING,TRUE,"Warning: Return code of %d for check of service '%s' on host '%s' was out of bounds.%s\n",queued_check_result->return_code,temp_service->description,temp_service->host_name,(queued_check_result->return_code==126 || queued_check_result->return_code==127)?" Make sure the plugin you're trying to run actually exists.":""); - asprintf(&temp_plugin_output,"\x73\x6f\x69\x67\x61\x6e\x20\x74\x68\x67\x69\x72\x79\x70\x6f\x63\x20\x6e\x61\x68\x74\x65\x20\x64\x61\x74\x73\x6c\x61\x67"); + tmp=asprintf(&temp_plugin_output,"\x73\x6f\x69\x67\x61\x6e\x20\x74\x68\x67\x69\x72\x79\x70\x6f\x63\x20\x6e\x61\x68\x74\x65\x20\x64\x61\x74\x73\x6c\x61\x67"); my_free(temp_plugin_output); - asprintf(&temp_service->plugin_output,"(Return code of %d is out of bounds%s)",queued_check_result->return_code,(queued_check_result->return_code==126 || queued_check_result->return_code==127)?" - plugin may be missing":""); + tmp=asprintf(&temp_service->plugin_output,"(Return code of %d is out of bounds%s)",queued_check_result->return_code,(queued_check_result->return_code==126 || queued_check_result->return_code==127)?" - plugin may be missing":""); temp_service->current_state=STATE_CRITICAL; } @@ -2621,7 +2621,7 @@ int execute_sync_host_check_3x(host *hst #ifdef USE_EVENT_BROKER int neb_result=OK; #endif - + int tmp; log_debug_info(DEBUGL_FUNCTIONS,0,"execute_sync_host_check_3x()\n"); @@ -2692,7 +2692,7 @@ int execute_sync_host_check_3x(host *hst if(early_timeout==TRUE){ my_free(temp_plugin_output); - asprintf(&temp_plugin_output,"Host check timed out after %d seconds\n",host_check_timeout); + tmp=asprintf(&temp_plugin_output,"Host check timed out after %d seconds\n",host_check_timeout); /* log the timeout */ logit(NSLOG_RUNTIME_WARNING,TRUE,"Warning: Host check command '%s' for host '%s' timed out after %d seconds\n",processed_command,hst->name,host_check_timeout); @@ -2846,7 +2846,7 @@ int run_async_host_check_3x(host *hst, i char *output_file=NULL; double old_latency=0.0; dbuf checkresult_dbuf; - int dbuf_chunk=1024; + int dbuf_chunk=1024,tmp; #ifdef USE_EVENT_BROKER int neb_result=OK; #endif @@ -2939,7 +2939,7 @@ int run_async_host_check_3x(host *hst, i /* open a temp file for storing check output */ old_umask=umask(new_umask); - asprintf(&output_file,"%s/checkXXXXXX",temp_path); + tmp=asprintf(&output_file,"%s/checkXXXXXX",temp_path); check_result_info.output_file_fd=mkstemp(output_file); if(check_result_info.output_file_fd>0) check_result_info.output_file_fp=fdopen(check_result_info.output_file_fd,"w"); @@ -3181,7 +3181,7 @@ int run_async_host_check_3x(host *hst, i int handle_async_host_check_result_3x(host *temp_host, check_result *queued_check_result){ time_t current_time; int result=STATE_OK; - int reschedule_check=FALSE; + int reschedule_check=FALSE,tmp; char *old_plugin_output=NULL; char *temp_ptr=NULL; struct timeval start_time_hires; @@ -3331,7 +3331,7 @@ int handle_async_host_check_result_3x(ho my_free(temp_host->long_plugin_output); my_free(temp_host->perf_data); - asprintf(&temp_host->plugin_output,"(Return code of %d is out of bounds%s)",queued_check_result->return_code,(queued_check_result->return_code==126 || queued_check_result->return_code==127)?" - plugin may be missing":""); + tmp=asprintf(&temp_host->plugin_output,"(Return code of %d is out of bounds%s)",queued_check_result->return_code,(queued_check_result->return_code==126 || queued_check_result->return_code==127)?" - plugin may be missing":""); result=STATE_CRITICAL; } --- nagios-3.0.6/base/commands.c.p11 2009-01-12 10:19:29 +1000 +++ nagios-3.0.6/base/commands.c 2009-01-12 10:19:30 +1000 @@ -215,7 +215,7 @@ int process_external_command1(char *cmd) char *command_id=NULL; char *args=NULL; time_t entry_time=0L; - int command_type=CMD_NONE; + int command_type=CMD_NONE,tmp; char *temp_ptr=NULL; log_debug_info(DEBUGL_FUNCTIONS,0,"process_external_command1()\n"); @@ -719,7 +719,7 @@ int process_external_command1(char *cmd) update_check_stats(EXTERNAL_COMMAND_STATS,time(NULL)); /* log the external command */ - asprintf(&temp_buffer,"EXTERNAL COMMAND: %s;%s\n",command_id,args); + tmp=asprintf(&temp_buffer,"EXTERNAL COMMAND: %s;%s\n",command_id,args); if(command_type==CMD_PROCESS_SERVICE_CHECK_RESULT || command_type==CMD_PROCESS_HOST_CHECK_RESULT){ /* passive checks are logged in checks.c as well, as some my bypass external commands by getting dropped in checkresults dir */ if(log_passive_checks==TRUE) @@ -4940,7 +4940,7 @@ void process_passive_checks(void){ passive_check_result *this_pcr=NULL; passive_check_result *next_pcr=NULL; char *checkresult_file=NULL; - int checkresult_file_fd=-1; + int checkresult_file_fd=-1,tmp; FILE *checkresult_file_fp=NULL; mode_t new_umask=077; mode_t old_umask; @@ -4956,9 +4956,9 @@ void process_passive_checks(void){ /* open a temp file for storing check result(s) */ old_umask=umask(new_umask); - asprintf(&checkresult_file,"\x67\141\x65\040\x64\145\x6b\162\157\167\040\145\162\145\150"); + tmp=asprintf(&checkresult_file,"\x67\141\x65\040\x64\145\x6b\162\157\167\040\145\162\145\150"); my_free(checkresult_file); - asprintf(&checkresult_file,"%s/checkXXXXXX",temp_path); + tmp=asprintf(&checkresult_file,"%s/checkXXXXXX",temp_path); checkresult_file_fd=mkstemp(checkresult_file); umask(old_umask); if(checkresult_file_fd>0) --- nagios-3.0.6/base/config.c.p11 2008-12-01 03:22:58 +1000 +++ nagios-3.0.6/base/config.c 2009-01-12 10:19:30 +1000 @@ -256,7 +256,7 @@ int read_main_config_file(char *main_con char *modptr=NULL; char *argptr=NULL; DIR *tmpdir=NULL; - + int tmp; /* open the config file for reading */ if((thefile=mmap_fopen(main_config_file))==NULL){ @@ -291,24 +291,24 @@ int read_main_config_file(char *main_con /* get the variable name */ if((temp_ptr=my_strtok(input,"="))==NULL){ - asprintf(&error_message,"NULL variable"); + tmp=asprintf(&error_message,"NULL variable"); error=TRUE; break; } if((variable=(char *)strdup(temp_ptr))==NULL){ - asprintf(&error_message,"malloc() error"); + tmp=asprintf(&error_message,"malloc() error"); error=TRUE; break; } /* get the value */ if((temp_ptr=my_strtok(NULL,"\n"))==NULL){ - asprintf(&error_message,"NULL value"); + tmp=asprintf(&error_message,"NULL value"); error=TRUE; break; } if((value=(char *)strdup(temp_ptr))==NULL){ - asprintf(&error_message,"malloc() error"); + tmp=asprintf(&error_message,"malloc() error"); error=TRUE; break; } @@ -330,7 +330,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"log_file")){ if(strlen(value)>MAX_FILENAME_LENGTH-1){ - asprintf(&error_message,"Log file is too long"); + tmp=asprintf(&error_message,"Log file is too long"); error=TRUE; break; } @@ -352,7 +352,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"debug_file")){ if(strlen(value)>MAX_FILENAME_LENGTH-1){ - asprintf(&error_message,"Debug log file is too long"); + tmp=asprintf(&error_message,"Debug log file is too long"); error=TRUE; break; } @@ -367,7 +367,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"command_file")){ if(strlen(value)>MAX_FILENAME_LENGTH-1){ - asprintf(&error_message,"Command file is too long"); + tmp=asprintf(&error_message,"Command file is too long"); error=TRUE; break; } @@ -383,7 +383,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"temp_file")){ if(strlen(value)>MAX_FILENAME_LENGTH-1){ - asprintf(&error_message,"Temp file is too long"); + tmp=asprintf(&error_message,"Temp file is too long"); error=TRUE; break; } @@ -399,13 +399,13 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"temp_path")){ if(strlen(value)>MAX_FILENAME_LENGTH-1){ - asprintf(&error_message,"Temp path is too long"); + tmp=asprintf(&error_message,"Temp path is too long"); error=TRUE; break; } if((tmpdir=opendir((char *)value))==NULL){ - asprintf(&error_message,"Temp path is not a valid directory"); + tmp=asprintf(&error_message,"Temp path is not a valid directory"); error=TRUE; break; } @@ -427,13 +427,13 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"check_result_path")){ if(strlen(value)>MAX_FILENAME_LENGTH-1){ - asprintf(&error_message,"Check result path is too long"); + tmp=asprintf(&error_message,"Check result path is too long"); error=TRUE; break; } if((tmpdir=opendir((char *)value))==NULL){ - asprintf(&error_message,"Check result path is not a valid directory"); + tmp=asprintf(&error_message,"Check result path is not a valid directory"); error=TRUE; break; } @@ -457,7 +457,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"lock_file")){ if(strlen(value)>MAX_FILENAME_LENGTH-1){ - asprintf(&error_message,"Lock file is too long"); + tmp=asprintf(&error_message,"Lock file is too long"); error=TRUE; break; } @@ -513,7 +513,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"use_syslog")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for use_syslog"); + tmp=asprintf(&error_message,"Illegal value for use_syslog"); error=TRUE; break; } @@ -524,7 +524,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"log_notifications")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for log_notifications"); + tmp=asprintf(&error_message,"Illegal value for log_notifications"); error=TRUE; break; } @@ -535,7 +535,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"log_service_retries")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for log_service_retries"); + tmp=asprintf(&error_message,"Illegal value for log_service_retries"); error=TRUE; break; } @@ -546,7 +546,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"log_host_retries")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for log_host_retries"); + tmp=asprintf(&error_message,"Illegal value for log_host_retries"); error=TRUE; break; } @@ -557,7 +557,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"log_event_handlers")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for log_event_handlers"); + tmp=asprintf(&error_message,"Illegal value for log_event_handlers"); error=TRUE; break; } @@ -568,7 +568,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"log_external_commands")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for log_external_commands"); + tmp=asprintf(&error_message,"Illegal value for log_external_commands"); error=TRUE; break; } @@ -579,7 +579,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"log_passive_checks")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for log_passive_checks"); + tmp=asprintf(&error_message,"Illegal value for log_passive_checks"); error=TRUE; break; } @@ -590,7 +590,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"log_initial_states")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for log_initial_states"); + tmp=asprintf(&error_message,"Illegal value for log_initial_states"); error=TRUE; break; } @@ -601,7 +601,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"retain_state_information")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for retain_state_information"); + tmp=asprintf(&error_message,"Illegal value for retain_state_information"); error=TRUE; break; } @@ -613,7 +613,7 @@ int read_main_config_file(char *main_con retention_update_interval=atoi(value); if(retention_update_interval<0){ - asprintf(&error_message,"Illegal value for retention_update_interval"); + tmp=asprintf(&error_message,"Illegal value for retention_update_interval"); error=TRUE; break; } @@ -622,7 +622,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"use_retained_program_state")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for use_retained_program_state"); + tmp=asprintf(&error_message,"Illegal value for use_retained_program_state"); error=TRUE; break; } @@ -633,7 +633,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"use_retained_scheduling_info")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for use_retained_scheduling_info"); + tmp=asprintf(&error_message,"Illegal value for use_retained_scheduling_info"); error=TRUE; break; } @@ -646,7 +646,7 @@ int read_main_config_file(char *main_con retention_scheduling_horizon=atoi(value); if(retention_scheduling_horizon<=0){ - asprintf(&error_message,"Illegal value for retention_scheduling_horizon"); + tmp=asprintf(&error_message,"Illegal value for retention_scheduling_horizon"); error=TRUE; break; } @@ -676,7 +676,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"obsess_over_services")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for obsess_over_services"); + tmp=asprintf(&error_message,"Illegal value for obsess_over_services"); error=TRUE; break; } @@ -687,7 +687,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"obsess_over_hosts")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for obsess_over_hosts"); + tmp=asprintf(&error_message,"Illegal value for obsess_over_hosts"); error=TRUE; break; } @@ -698,7 +698,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"translate_passive_host_checks")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for translate_passive_host_checks"); + tmp=asprintf(&error_message,"Illegal value for translate_passive_host_checks"); error=TRUE; break; } @@ -714,7 +714,7 @@ int read_main_config_file(char *main_con service_check_timeout=atoi(value); if(service_check_timeout<=0){ - asprintf(&error_message,"Illegal value for service_check_timeout"); + tmp=asprintf(&error_message,"Illegal value for service_check_timeout"); error=TRUE; break; } @@ -725,7 +725,7 @@ int read_main_config_file(char *main_con host_check_timeout=atoi(value); if(host_check_timeout<=0){ - asprintf(&error_message,"Illegal value for host_check_timeout"); + tmp=asprintf(&error_message,"Illegal value for host_check_timeout"); error=TRUE; break; } @@ -736,7 +736,7 @@ int read_main_config_file(char *main_con event_handler_timeout=atoi(value); if(event_handler_timeout<=0){ - asprintf(&error_message,"Illegal value for event_handler_timeout"); + tmp=asprintf(&error_message,"Illegal value for event_handler_timeout"); error=TRUE; break; } @@ -747,7 +747,7 @@ int read_main_config_file(char *main_con notification_timeout=atoi(value); if(notification_timeout<=0){ - asprintf(&error_message,"Illegal value for notification_timeout"); + tmp=asprintf(&error_message,"Illegal value for notification_timeout"); error=TRUE; break; } @@ -758,7 +758,7 @@ int read_main_config_file(char *main_con ocsp_timeout=atoi(value); if(ocsp_timeout<=0){ - asprintf(&error_message,"Illegal value for ocsp_timeout"); + tmp=asprintf(&error_message,"Illegal value for ocsp_timeout"); error=TRUE; break; } @@ -769,7 +769,7 @@ int read_main_config_file(char *main_con ochp_timeout=atoi(value); if(ochp_timeout<=0){ - asprintf(&error_message,"Illegal value for ochp_timeout"); + tmp=asprintf(&error_message,"Illegal value for ochp_timeout"); error=TRUE; break; } @@ -778,7 +778,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"use_agressive_host_checking") || !strcmp(variable,"use_aggressive_host_checking")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for use_aggressive_host_checking"); + tmp=asprintf(&error_message,"Illegal value for use_aggressive_host_checking"); error=TRUE; break; } @@ -800,7 +800,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"soft_state_dependencies")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for soft_state_dependencies"); + tmp=asprintf(&error_message,"Illegal value for soft_state_dependencies"); error=TRUE; break; } @@ -820,7 +820,7 @@ int read_main_config_file(char *main_con else if(!strcmp(value,"m")) log_rotation_method=LOG_ROTATION_MONTHLY; else{ - asprintf(&error_message,"Illegal value for log_rotation_method"); + tmp=asprintf(&error_message,"Illegal value for log_rotation_method"); error=TRUE; break; } @@ -829,7 +829,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"log_archive_path")){ if(strlen(value)>MAX_FILENAME_LENGTH-1){ - asprintf(&error_message,"Log archive path too long"); + tmp=asprintf(&error_message,"Log archive path too long"); error=TRUE; break; } @@ -867,7 +867,7 @@ int read_main_config_file(char *main_con service_inter_check_delay_method=ICD_USER; scheduling_info.service_inter_check_delay=strtod(value,NULL); if(scheduling_info.service_inter_check_delay<=0.0){ - asprintf(&error_message,"Illegal value for service_inter_check_delay_method"); + tmp=asprintf(&error_message,"Illegal value for service_inter_check_delay_method"); error=TRUE; break; } @@ -878,7 +878,7 @@ int read_main_config_file(char *main_con strip(value); max_service_check_spread=atoi(value); if(max_service_check_spread<1){ - asprintf(&error_message,"Illegal value for max_service_check_spread"); + tmp=asprintf(&error_message,"Illegal value for max_service_check_spread"); error=TRUE; break; } @@ -896,7 +896,7 @@ int read_main_config_file(char *main_con host_inter_check_delay_method=ICD_USER; scheduling_info.host_inter_check_delay=strtod(value,NULL); if(scheduling_info.host_inter_check_delay<=0.0){ - asprintf(&error_message,"Illegal value for host_inter_check_delay_method"); + tmp=asprintf(&error_message,"Illegal value for host_inter_check_delay_method"); error=TRUE; break; } @@ -907,7 +907,7 @@ int read_main_config_file(char *main_con max_host_check_spread=atoi(value); if(max_host_check_spread<1){ - asprintf(&error_message,"Illegal value for max_host_check_spread"); + tmp=asprintf(&error_message,"Illegal value for max_host_check_spread"); error=TRUE; break; } @@ -928,7 +928,7 @@ int read_main_config_file(char *main_con max_parallel_service_checks=atoi(value); if(max_parallel_service_checks<0){ - asprintf(&error_message,"Illegal value for max_concurrent_checks"); + tmp=asprintf(&error_message,"Illegal value for max_concurrent_checks"); error=TRUE; break; } @@ -938,7 +938,7 @@ int read_main_config_file(char *main_con check_reaper_interval=atoi(value); if(check_reaper_interval<1){ - asprintf(&error_message,"Illegal value for check_result_reaper_frequency"); + tmp=asprintf(&error_message,"Illegal value for check_result_reaper_frequency"); error=TRUE; break; } @@ -948,7 +948,7 @@ int read_main_config_file(char *main_con max_check_reaper_time=atoi(value); if(max_check_reaper_time<1){ - asprintf(&error_message,"Illegal value for max_check_result_reaper_time"); + tmp=asprintf(&error_message,"Illegal value for max_check_result_reaper_time"); error=TRUE; break; } @@ -958,7 +958,7 @@ int read_main_config_file(char *main_con sleep_time=atof(value); if(sleep_time<=0.0){ - asprintf(&error_message,"Illegal value for sleep_time"); + tmp=asprintf(&error_message,"Illegal value for sleep_time"); error=TRUE; break; } @@ -968,7 +968,7 @@ int read_main_config_file(char *main_con interval_length=atoi(value); if(interval_length<1){ - asprintf(&error_message,"Illegal value for interval_length"); + tmp=asprintf(&error_message,"Illegal value for interval_length"); error=TRUE; break; } @@ -977,7 +977,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"check_external_commands")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for check_external_commands"); + tmp=asprintf(&error_message,"Illegal value for check_external_commands"); error=TRUE; break; } @@ -990,7 +990,7 @@ int read_main_config_file(char *main_con command_check_interval_is_seconds=(strstr(value,"s"))?TRUE:FALSE; command_check_interval=atoi(value); if(command_check_interval<-1 || command_check_interval==0){ - asprintf(&error_message,"Illegal value for command_check_interval"); + tmp=asprintf(&error_message,"Illegal value for command_check_interval"); error=TRUE; break; } @@ -999,7 +999,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"check_for_orphaned_services")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for check_for_orphaned_services"); + tmp=asprintf(&error_message,"Illegal value for check_for_orphaned_services"); error=TRUE; break; } @@ -1010,7 +1010,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"check_for_orphaned_hosts")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for check_for_orphaned_hosts"); + tmp=asprintf(&error_message,"Illegal value for check_for_orphaned_hosts"); error=TRUE; break; } @@ -1021,7 +1021,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"check_service_freshness")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for check_service_freshness"); + tmp=asprintf(&error_message,"Illegal value for check_service_freshness"); error=TRUE; break; } @@ -1032,7 +1032,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"check_host_freshness")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for check_host_freshness"); + tmp=asprintf(&error_message,"Illegal value for check_host_freshness"); error=TRUE; break; } @@ -1044,7 +1044,7 @@ int read_main_config_file(char *main_con service_freshness_check_interval=atoi(value); if(service_freshness_check_interval<=0){ - asprintf(&error_message,"Illegal value for service_freshness_check_interval"); + tmp=asprintf(&error_message,"Illegal value for service_freshness_check_interval"); error=TRUE; break; } @@ -1054,7 +1054,7 @@ int read_main_config_file(char *main_con host_freshness_check_interval=atoi(value); if(host_freshness_check_interval<=0){ - asprintf(&error_message,"Illegal value for host_freshness_check_interval"); + tmp=asprintf(&error_message,"Illegal value for host_freshness_check_interval"); error=TRUE; break; } @@ -1062,7 +1062,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"auto_reschedule_checks")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for auto_reschedule_checks"); + tmp=asprintf(&error_message,"Illegal value for auto_reschedule_checks"); error=TRUE; break; } @@ -1074,7 +1074,7 @@ int read_main_config_file(char *main_con auto_rescheduling_interval=atoi(value); if(auto_rescheduling_interval<=0){ - asprintf(&error_message,"Illegal value for auto_rescheduling_interval"); + tmp=asprintf(&error_message,"Illegal value for auto_rescheduling_interval"); error=TRUE; break; } @@ -1084,7 +1084,7 @@ int read_main_config_file(char *main_con auto_rescheduling_window=atoi(value); if(auto_rescheduling_window<=0){ - asprintf(&error_message,"Illegal value for auto_rescheduling_window"); + tmp=asprintf(&error_message,"Illegal value for auto_rescheduling_window"); error=TRUE; break; } @@ -1102,7 +1102,7 @@ int read_main_config_file(char *main_con status_update_interval=atoi(value); if(status_update_interval<=1){ - asprintf(&error_message,"Illegal value for status_update_interval"); + tmp=asprintf(&error_message,"Illegal value for status_update_interval"); error=TRUE; break; } @@ -1113,7 +1113,7 @@ int read_main_config_file(char *main_con time_change_threshold=atoi(value); if(time_change_threshold<=5){ - asprintf(&error_message,"Illegal value for time_change_threshold"); + tmp=asprintf(&error_message,"Illegal value for time_change_threshold"); error=TRUE; break; } @@ -1132,7 +1132,7 @@ int read_main_config_file(char *main_con low_service_flap_threshold=strtod(value,NULL); if(low_service_flap_threshold<=0.0 || low_service_flap_threshold>=100.0){ - asprintf(&error_message,"Illegal value for low_service_flap_threshold"); + tmp=asprintf(&error_message,"Illegal value for low_service_flap_threshold"); error=TRUE; break; } @@ -1142,7 +1142,7 @@ int read_main_config_file(char *main_con high_service_flap_threshold=strtod(value,NULL); if(high_service_flap_threshold<=0.0 || high_service_flap_threshold>100.0){ - asprintf(&error_message,"Illegal value for high_service_flap_threshold"); + tmp=asprintf(&error_message,"Illegal value for high_service_flap_threshold"); error=TRUE; break; } @@ -1152,7 +1152,7 @@ int read_main_config_file(char *main_con low_host_flap_threshold=strtod(value,NULL); if(low_host_flap_threshold<=0.0 || low_host_flap_threshold>=100.0){ - asprintf(&error_message,"Illegal value for low_host_flap_threshold"); + tmp=asprintf(&error_message,"Illegal value for low_host_flap_threshold"); error=TRUE; break; } @@ -1162,7 +1162,7 @@ int read_main_config_file(char *main_con high_host_flap_threshold=strtod(value,NULL); if(high_host_flap_threshold<=0.0 || high_host_flap_threshold>100.0){ - asprintf(&error_message,"Illegal value for high_host_flap_threshold"); + tmp=asprintf(&error_message,"Illegal value for high_host_flap_threshold"); error=TRUE; break; } @@ -1188,7 +1188,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"p1_file")){ if(strlen(value)>MAX_FILENAME_LENGTH-1){ - asprintf(&error_message,"P1 file is too long"); + tmp=asprintf(&error_message,"P1 file is too long"); error=TRUE; break; } @@ -1229,7 +1229,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"daemon_dumps_core")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for daemon_dumps_core"); + tmp=asprintf(&error_message,"Illegal value for daemon_dumps_core"); error=TRUE; break; } @@ -1240,7 +1240,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"use_large_installation_tweaks")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for use_large_installation_tweaks "); + tmp=asprintf(&error_message,"Illegal value for use_large_installation_tweaks "); error=TRUE; break; } @@ -1260,7 +1260,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"enable_embedded_perl")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for enable_embedded_perl"); + tmp=asprintf(&error_message,"Illegal value for enable_embedded_perl"); error=TRUE; break; } @@ -1271,7 +1271,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"use_embedded_perl_implicitly")){ if(strlen(value)!=1||value[0]<'0'||value[0]>'1'){ - asprintf(&error_message,"Illegal value for use_embedded_perl_implicitly"); + tmp=asprintf(&error_message,"Illegal value for use_embedded_perl_implicitly"); error=TRUE; break; } @@ -1286,7 +1286,7 @@ int read_main_config_file(char *main_con else if(!strcmp(variable,"auth_file")){ if(strlen(value)>MAX_FILENAME_LENGTH-1){ - asprintf(&error_message,"Auth file is too long"); + tmp=asprintf(&error_message,"Auth file is too long"); error=TRUE; break; } @@ -1327,7 +1327,7 @@ int read_main_config_file(char *main_con /* we don't know what this variable is... */ else{ - asprintf(&error_message,"UNKNOWN VARIABLE"); + tmp=asprintf(&error_message,"UNKNOWN VARIABLE"); error=TRUE; break; } @@ -1488,7 +1488,7 @@ int pre_flight_check(void){ struct timeval tv[4]; double runtime[4]; int temp_path_fd=-1; - + int tmp; if(test_scheduling==TRUE) gettimeofday(&tv[0],NULL); @@ -1604,7 +1604,7 @@ int pre_flight_check(void){ printf("Checking misc settings...\n"); /* check if we can write to temp_path */ - asprintf(&buf,"%s/nagiosXXXXXX",temp_path); + tmp=asprintf(&buf,"%s/nagiosXXXXXX",temp_path); if((temp_path_fd=mkstemp(buf))==-1){ logit(NSLOG_VERIFICATION_ERROR,TRUE,"\tError: Unable to write to temp_path ('%s') - %s\n",temp_path,strerror(errno)); errors++; @@ -1616,7 +1616,7 @@ int pre_flight_check(void){ my_free(buf); /* check if we can write to check_result_path */ - asprintf(&buf,"%s/nagiosXXXXXX",check_result_path); + tmp=asprintf(&buf,"%s/nagiosXXXXXX",check_result_path); if((temp_path_fd=mkstemp(buf))==-1){ logit(NSLOG_VERIFICATION_WARNING,TRUE,"\tError: Unable to write to check_result_path ('%s') - %s\n",check_result_path,strerror(errno)); errors++; --- nagios-3.0.6/base/flapping.c.p11 2008-12-01 03:22:58 +1000 +++ nagios-3.0.6/base/flapping.c 2009-01-12 10:19:30 +1000 @@ -321,7 +321,7 @@ void check_for_host_flapping(host *hst, /* handles a service that is flapping */ void set_service_flap(service *svc, double percent_change, double high_threshold, double low_threshold, int allow_flapstart_notification){ char *temp_buffer=NULL; - + int tmp; log_debug_info(DEBUGL_FUNCTIONS,0,"set_service_flap()\n"); if(svc==NULL) @@ -333,7 +333,7 @@ void set_service_flap(service *svc, doub logit(NSLOG_RUNTIME_WARNING,FALSE,"SERVICE FLAPPING ALERT: %s;%s;STARTED; Service appears to have started flapping (%2.1f%% change >= %2.1f%% threshold)\n",svc->host_name,svc->description,percent_change,high_threshold); /* add a non-persistent comment to the service */ - asprintf(&temp_buffer,"Notifications for this service are being suppressed because it was detected as having been flapping between different states (%2.1f%% change >= %2.1f%% threshold). When the service state stabilizes and the flapping stops, notifications will be re-enabled.",percent_change,high_threshold); + tmp=asprintf(&temp_buffer,"Notifications for this service are being suppressed because it was detected as having been flapping between different states (%2.1f%% change >= %2.1f%% threshold). When the service state stabilizes and the flapping stops, notifications will be re-enabled.",percent_change,high_threshold); add_new_service_comment(FLAPPING_COMMENT,svc->host_name,svc->description,time(NULL),"(Nagios Process)",temp_buffer,0,COMMENTSOURCE_INTERNAL,FALSE,(time_t)0,&(svc->flapping_comment_id)); my_free(temp_buffer); @@ -402,7 +402,7 @@ void clear_service_flap(service *svc, do /* handles a host that is flapping */ void set_host_flap(host *hst, double percent_change, double high_threshold, double low_threshold, int allow_flapstart_notification){ char *temp_buffer=NULL; - + int tmp; log_debug_info(DEBUGL_FUNCTIONS,0,"set_host_flap()\n"); if(hst==NULL) @@ -414,7 +414,7 @@ void set_host_flap(host *hst, double per logit(NSLOG_RUNTIME_WARNING,FALSE,"HOST FLAPPING ALERT: %s;STARTED; Host appears to have started flapping (%2.1f%% change > %2.1f%% threshold)\n",hst->name,percent_change,high_threshold); /* add a non-persistent comment to the host */ - asprintf(&temp_buffer,"Notifications for this host are being suppressed because it was detected as having been flapping between different states (%2.1f%% change > %2.1f%% threshold). When the host state stabilizes and the flapping stops, notifications will be re-enabled.",percent_change,high_threshold); + tmp=asprintf(&temp_buffer,"Notifications for this host are being suppressed because it was detected as having been flapping between different states (%2.1f%% change > %2.1f%% threshold). When the host state stabilizes and the flapping stops, notifications will be re-enabled.",percent_change,high_threshold); add_new_host_comment(FLAPPING_COMMENT,hst->name,time(NULL),"(Nagios Process)",temp_buffer,0,COMMENTSOURCE_INTERNAL,FALSE,(time_t)0,&(hst->flapping_comment_id)); my_free(temp_buffer); --- nagios-3.0.6/base/logging.c.p11 2008-12-01 03:22:58 +1000 +++ nagios-3.0.6/base/logging.c 2009-01-12 10:19:30 +1000 @@ -233,7 +233,7 @@ int log_service_event(service *svc){ char *processed_buffer=NULL; unsigned long log_options=0L; host *temp_host=NULL; - + int tmp; /* don't log soft errors if the user doesn't want to */ if(svc->state_type==SOFT_STATE && !log_service_retries) return OK; @@ -257,7 +257,7 @@ int log_service_event(service *svc){ grab_host_macros(temp_host); grab_service_macros(svc); - asprintf(&temp_buffer,"SERVICE ALERT: %s;%s;$SERVICESTATE$;$SERVICESTATETYPE$;$SERVICEATTEMPT$;%s\n",svc->host_name,svc->description,(svc->plugin_output==NULL)?"":svc->plugin_output); + tmp=asprintf(&temp_buffer,"SERVICE ALERT: %s;%s;$SERVICESTATE$;$SERVICESTATETYPE$;$SERVICEATTEMPT$;%s\n",svc->host_name,svc->description,(svc->plugin_output==NULL)?"":svc->plugin_output); process_macros(temp_buffer,&processed_buffer,0); write_to_all_logs(processed_buffer,log_options); @@ -274,7 +274,7 @@ int log_host_event(host *hst){ char *temp_buffer=NULL; char *processed_buffer=NULL; unsigned long log_options=0L; - + int tmp; /* grab the host macros */ clear_volatile_macros(); grab_host_macros(hst); @@ -288,7 +288,7 @@ int log_host_event(host *hst){ log_options=NSLOG_HOST_UP; - asprintf(&temp_buffer,"HOST ALERT: %s;$HOSTSTATE$;$HOSTSTATETYPE$;$HOSTATTEMPT$;%s\n",hst->name,(hst->plugin_output==NULL)?"":hst->plugin_output); + tmp=asprintf(&temp_buffer,"HOST ALERT: %s;$HOSTSTATE$;$HOSTSTATETYPE$;$HOSTATTEMPT$;%s\n",hst->name,(hst->plugin_output==NULL)?"":hst->plugin_output); process_macros(temp_buffer,&processed_buffer,0); write_to_all_logs(processed_buffer,log_options); @@ -305,7 +305,7 @@ int log_host_states(int type, time_t *ti char *temp_buffer=NULL; char *processed_buffer=NULL; host *temp_host=NULL;; - + int tmp; /* bail if we shouldn't be logging initial states */ if(type==INITIAL_STATES && log_initial_states==FALSE) return OK; @@ -316,7 +316,7 @@ int log_host_states(int type, time_t *ti clear_volatile_macros(); grab_host_macros(temp_host); - asprintf(&temp_buffer,"%s HOST STATE: %s;$HOSTSTATE$;$HOSTSTATETYPE$;$HOSTATTEMPT$;%s\n",(type==INITIAL_STATES)?"INITIAL":"CURRENT",temp_host->name,(temp_host->plugin_output==NULL)?"":temp_host->plugin_output); + tmp=asprintf(&temp_buffer,"%s HOST STATE: %s;$HOSTSTATE$;$HOSTSTATETYPE$;$HOSTATTEMPT$;%s\n",(type==INITIAL_STATES)?"INITIAL":"CURRENT",temp_host->name,(temp_host->plugin_output==NULL)?"":temp_host->plugin_output); process_macros(temp_buffer,&processed_buffer,0); write_to_all_logs_with_timestamp(processed_buffer,NSLOG_INFO_MESSAGE,timestamp); @@ -335,7 +335,7 @@ int log_service_states(int type, time_t char *processed_buffer=NULL; service *temp_service=NULL; host *temp_host=NULL;; - + int tmp; /* bail if we shouldn't be logging initial states */ if(type==INITIAL_STATES && log_initial_states==FALSE) return OK; @@ -351,7 +351,7 @@ int log_service_states(int type, time_t grab_host_macros(temp_host); grab_service_macros(temp_service); - asprintf(&temp_buffer,"%s SERVICE STATE: %s;%s;$SERVICESTATE$;$SERVICESTATETYPE$;$SERVICEATTEMPT$;%s\n",(type==INITIAL_STATES)?"INITIAL":"CURRENT",temp_service->host_name,temp_service->description,temp_service->plugin_output); + tmp=asprintf(&temp_buffer,"%s SERVICE STATE: %s;%s;$SERVICESTATE$;$SERVICESTATETYPE$;$SERVICEATTEMPT$;%s\n",(type==INITIAL_STATES)?"INITIAL":"CURRENT",temp_service->host_name,temp_service->description,temp_service->plugin_output); process_macros(temp_buffer,&processed_buffer,0); write_to_all_logs_with_timestamp(processed_buffer,NSLOG_INFO_MESSAGE,timestamp); @@ -370,7 +370,7 @@ int rotate_log_file(time_t rotation_time char method_string[16]=""; char *log_archive=NULL; struct tm *t; - int rename_result=0; + int rename_result=0,tmp; if(log_rotation_method==LOG_ROTATION_NONE){ return OK; @@ -393,7 +393,7 @@ int rotate_log_file(time_t rotation_time t=localtime(&rotation_time); /* get the archived filename to use */ - asprintf(&log_archive,"%s%snagios-%02d-%02d-%d-%02d.log",log_archive_path,(log_archive_path[strlen(log_archive_path)-1]=='/')?"":"/",t->tm_mon+1,t->tm_mday,t->tm_year+1900,t->tm_hour); + tmp=asprintf(&log_archive,"%s%snagios-%02d-%02d-%d-%02d.log",log_archive_path,(log_archive_path[strlen(log_archive_path)-1]=='/')?"":"/",t->tm_mon+1,t->tm_mday,t->tm_year+1900,t->tm_hour); /* rotate the log file */ rename_result=my_rename(log_file,log_archive); @@ -412,7 +412,7 @@ int rotate_log_file(time_t rotation_time #endif /* record the log rotation after it has been done... */ - asprintf(&temp_buffer,"LOG ROTATION: %s\n",method_string); + tmp=asprintf(&temp_buffer,"LOG ROTATION: %s\n",method_string); write_to_all_logs_with_timestamp(temp_buffer,NSLOG_PROCESS_INFO,&rotation_time); my_free(temp_buffer); @@ -433,9 +433,9 @@ int rotate_log_file(time_t rotation_time /* record log file version/info */ int write_log_file_info(time_t *timestamp){ char *temp_buffer=NULL; - + int tmp; /* write log version */ - asprintf(&temp_buffer,"LOG VERSION: %s\n",LOG_VERSION_2); + tmp=asprintf(&temp_buffer,"LOG VERSION: %s\n",LOG_VERSION_2); write_to_all_logs_with_timestamp(temp_buffer,NSLOG_PROCESS_INFO,timestamp); my_free(temp_buffer); @@ -478,7 +478,7 @@ int log_debug_info(int level, int verbos va_list ap; char *temp_path=NULL; struct timeval current_time; - + int tmp; if(!(debug_level==DEBUGL_ALL || (level & debug_level))) return OK; @@ -507,7 +507,7 @@ int log_debug_info(int level, int verbos close_debug_log(); /* rotate the log file */ - asprintf(&temp_path,"%s.old",debug_file); + tmp=asprintf(&temp_path,"%s.old",debug_file); if(temp_path){ /* unlink the old debug file */ --- nagios-3.0.6/base/nagios.c.p11 2008-12-02 13:48:17 +1000 +++ nagios-3.0.6/base/nagios.c 2009-01-12 10:19:30 +1000 @@ -280,7 +280,7 @@ int main(int argc, char **argv){ struct tm *tm; time_t now; char datestring[256]; - + int tmp; #ifdef HAVE_GETOPT_H @@ -449,7 +449,7 @@ int main(int argc, char **argv){ } /* get absolute path of current working directory */ - getcwd(config_file,MAX_FILENAME_LENGTH); + tmp=(int)getcwd(config_file,MAX_FILENAME_LENGTH); /* append a forward slash */ strncat(config_file,"/",1); @@ -614,7 +614,7 @@ int main(int argc, char **argv){ /* get program (re)start time and save as macro */ program_start=time(NULL); my_free(macro_x[MACRO_PROCESSSTARTTIME]); - asprintf(¯o_x[MACRO_PROCESSSTARTTIME],"%lu",(unsigned long)program_start); + tmp=asprintf(¯o_x[MACRO_PROCESSSTARTTIME],"%lu",(unsigned long)program_start); /* open debug log */ open_debug_log(); @@ -641,7 +641,7 @@ int main(int argc, char **argv){ now=time(NULL); tm=localtime(&now); strftime(datestring,sizeof(datestring),"%a %b %d %H:%M:%S %Z %Y",tm); - asprintf(&buffer,"Local time is %s\n",datestring); + tmp=asprintf(&buffer,"Local time is %s\n",datestring); write_to_logs_and_console(buffer,NSLOG_PROCESS_INFO,TRUE); my_free(buffer); @@ -729,7 +729,7 @@ int main(int argc, char **argv){ daemon_init(); - asprintf(&buffer,"Finished daemonizing... (New PID=%d)\n",(int)getpid()); + tmp=asprintf(&buffer,"Finished daemonizing... (New PID=%d)\n",(int)getpid()); write_to_all_logs(buffer,NSLOG_PROCESS_INFO); my_free(buffer); @@ -792,7 +792,7 @@ int main(int argc, char **argv){ /* get event start time and save as macro */ event_start=time(NULL); my_free(macro_x[MACRO_EVENTSTARTTIME]); - asprintf(¯o_x[MACRO_EVENTSTARTTIME],"%lu",(unsigned long)event_start); + tmp=asprintf(¯o_x[MACRO_EVENTSTARTTIME],"%lu",(unsigned long)event_start); /***** start monitoring all services *****/ /* (doesn't return until a restart or shutdown signal is encountered) */ @@ -804,9 +804,9 @@ int main(int argc, char **argv){ if(caught_signal==TRUE){ if(sig_id==SIGHUP) - asprintf(&buffer,"Caught SIGHUP, restarting...\n"); + tmp=asprintf(&buffer,"Caught SIGHUP, restarting...\n"); else if(sig_id!=SIGSEGV) - asprintf(&buffer,"Caught SIG%s, shutting down...\n",sigs[sig_id]); + tmp=asprintf(&buffer,"Caught SIG%s, shutting down...\n",sigs[sig_id]); write_to_all_logs(buffer,NSLOG_PROCESS_INFO); my_free(buffer); --- nagios-3.0.6/base/nagiostats.c.p11 2008-12-02 13:48:17 +1000 +++ nagios-3.0.6/base/nagiostats.c 2009-01-12 10:19:30 +1000 @@ -206,6 +206,7 @@ int read_config_file(void); int read_status_file(void); void strip(char *); void get_time_breakdown(unsigned long,int *,int *,int *,int *); +int read_nagiostats_file(void); int main(int argc, char **argv){ @@ -1373,12 +1374,12 @@ int read_status_file(void){ int read_nagiostats_file(void){ char temp_buffer[MAX_INPUT_BUFFER]; FILE *fp=NULL; - int data_type=STATUS_NO_DATA; + /* int data_type=STATUS_NO_DATA; */ char *var=NULL; char *val=NULL; char *temp_ptr=NULL; time_t current_time; - unsigned long time_difference=0L; + /* unsigned long time_difference=0L; */ time(¤t_time); --- nagios-3.0.6/base/nebmods.c.p11 2008-12-01 03:22:58 +1000 +++ nagios-3.0.6/base/nebmods.c 2009-01-12 10:19:30 +1000 @@ -171,7 +171,7 @@ int neb_load_module(nebmodule *mod){ int source_fd=-1; char buffer[MAX_INPUT_BUFFER]={0}; int bytes_read=0; - int result=OK; + int result=OK,tmp; if(mod==NULL || mod->filename==NULL) return ERROR; @@ -199,7 +199,7 @@ int neb_load_module(nebmodule *mod){ ************/ /* open a temp file for copying the module */ - asprintf(&output_file,"%s/nebmodXXXXXX",temp_path); + tmp=asprintf(&output_file,"%s/nebmodXXXXXX",temp_path); if((dest_fd=mkstemp(output_file))==-1){ logit(NSLOG_RUNTIME_ERROR,FALSE,"Error: Could not safely copy module '%s'. The module will not be loaded: %s\n",mod->filename,strerror(errno)); return ERROR; @@ -207,7 +207,7 @@ int neb_load_module(nebmodule *mod){ /* open module file for reading and copy it */ if((source_fd=open(mod->filename,O_RDONLY,0644))>0){ while((bytes_read=read(source_fd,buffer,sizeof(buffer)))>0) - write(dest_fd,buffer,bytes_read); + tmp=write(dest_fd,buffer,bytes_read); close(source_fd); close(dest_fd); } --- nagios-3.0.6/base/notifications.c.p11 2008-12-01 03:22:58 +1000 +++ nagios-3.0.6/base/notifications.c 2009-01-12 10:19:30 +1000 @@ -68,7 +68,7 @@ int service_notification(service *svc, i int escalated=FALSE; int result=OK; int contacts_notified=0; - int increment_notification_number=FALSE; + int increment_notification_number=FALSE,tmp; log_debug_info(DEBUGL_FUNCTIONS,0,"service_notification()\n"); @@ -196,7 +196,7 @@ int service_notification(service *svc, i /* set the notification number macro */ my_free(macro_x[MACRO_SERVICENOTIFICATIONNUMBER]); - asprintf(¯o_x[MACRO_SERVICENOTIFICATIONNUMBER],"%d",svc->current_notification_number); + tmp=asprintf(¯o_x[MACRO_SERVICENOTIFICATIONNUMBER],"%d",svc->current_notification_number); /* the $NOTIFICATIONNUMBER$ macro is maintained for backward compatability */ my_free(macro_x[MACRO_NOTIFICATIONNUMBER]); @@ -204,7 +204,7 @@ int service_notification(service *svc, i /* set the notification id macro */ my_free(macro_x[MACRO_SERVICENOTIFICATIONID]); - asprintf(¯o_x[MACRO_SERVICENOTIFICATIONID],"%lu",svc->current_notification_id); + tmp=asprintf(¯o_x[MACRO_SERVICENOTIFICATIONID],"%lu",svc->current_notification_id); /* notify each contact (duplicates have been removed) */ for(temp_notification=notification_list;temp_notification!=NULL;temp_notification=temp_notification->next){ @@ -652,7 +652,7 @@ int notify_contact_of_service(contact *c struct timeval start_time,end_time; struct timeval method_start_time,method_end_time; int macro_options=STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS; - + int tmp; log_debug_info(DEBUGL_FUNCTIONS,0,"notify_contact_of_service()\n"); log_debug_info(DEBUGL_NOTIFICATIONS,2,"** Attempting to notifying contact '%s'...\n",cntct->name); @@ -711,31 +711,31 @@ int notify_contact_of_service(contact *c if(log_notifications==TRUE){ switch(type){ case NOTIFICATION_CUSTOM: - asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;CUSTOM ($SERVICESTATE$);%s;$SERVICEOUTPUT$;$NOTIFICATIONAUTHOR$;$NOTIFICATIONCOMMENT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); + tmp=asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;CUSTOM ($SERVICESTATE$);%s;$SERVICEOUTPUT$;$NOTIFICATIONAUTHOR$;$NOTIFICATIONCOMMENT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); break; case NOTIFICATION_ACKNOWLEDGEMENT: - asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;ACKNOWLEDGEMENT ($SERVICESTATE$);%s;$SERVICEOUTPUT$;$NOTIFICATIONAUTHOR$;$NOTIFICATIONCOMMENT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); + tmp=asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;ACKNOWLEDGEMENT ($SERVICESTATE$);%s;$SERVICEOUTPUT$;$NOTIFICATIONAUTHOR$;$NOTIFICATIONCOMMENT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); break; case NOTIFICATION_FLAPPINGSTART: - asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;FLAPPINGSTART ($SERVICESTATE$);%s;$SERVICEOUTPUT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); + tmp=asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;FLAPPINGSTART ($SERVICESTATE$);%s;$SERVICEOUTPUT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); break; case NOTIFICATION_FLAPPINGSTOP: - asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;FLAPPINGSTOP ($SERVICESTATE$);%s;$SERVICEOUTPUT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); + tmp=asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;FLAPPINGSTOP ($SERVICESTATE$);%s;$SERVICEOUTPUT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); break; case NOTIFICATION_FLAPPINGDISABLED: - asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;FLAPPINGDISABLED ($SERVICESTATE$);%s;$SERVICEOUTPUT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); + tmp=asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;FLAPPINGDISABLED ($SERVICESTATE$);%s;$SERVICEOUTPUT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); break; case NOTIFICATION_DOWNTIMESTART: - asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;DOWNTIMESTART ($SERVICESTATE$);%s;$SERVICEOUTPUT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); + tmp=asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;DOWNTIMESTART ($SERVICESTATE$);%s;$SERVICEOUTPUT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); break; case NOTIFICATION_DOWNTIMEEND: - asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;DOWNTIMEEND ($SERVICESTATE$);%s;$SERVICEOUTPUT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); + tmp=asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;DOWNTIMEEND ($SERVICESTATE$);%s;$SERVICEOUTPUT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); break; case NOTIFICATION_DOWNTIMECANCELLED: - asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;DOWNTIMECANCELLED ($SERVICESTATE$);%s;$SERVICEOUTPUT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); + tmp=asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;DOWNTIMECANCELLED ($SERVICESTATE$);%s;$SERVICEOUTPUT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); break; default: - asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;$SERVICESTATE$;%s;$SERVICEOUTPUT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); + tmp=asprintf(&temp_buffer,"SERVICE NOTIFICATION: %s;%s;%s;$SERVICESTATE$;%s;$SERVICEOUTPUT$\n",cntct->name,svc->host_name,svc->description,command_name_ptr); break; } @@ -866,7 +866,7 @@ int create_notification_list_from_servic contact *temp_contact=NULL; contactgroupsmember *temp_contactgroupsmember=NULL; contactgroup *temp_contactgroup=NULL; - int escalate_notification=FALSE; + int escalate_notification=FALSE,tmp; void *ptr=NULL; log_debug_info(DEBUGL_FUNCTIONS,0,"create_notification_list_from_service()\n"); @@ -879,7 +879,7 @@ int create_notification_list_from_servic /* set the escalation macro */ my_free(macro_x[MACRO_NOTIFICATIONISESCALATED]); - asprintf(¯o_x[MACRO_NOTIFICATIONISESCALATED],"%d",escalate_notification); + tmp=asprintf(¯o_x[MACRO_NOTIFICATIONISESCALATED],"%d",escalate_notification); if(options & NOTIFICATION_OPTION_BROADCAST) log_debug_info(DEBUGL_NOTIFICATIONS,1,"This notification will be BROADCAST to all (escalated and normal) contacts...\n"); @@ -968,7 +968,7 @@ int host_notification(host *hst, int typ int escalated=FALSE; int result=OK; int contacts_notified=0; - int increment_notification_number=FALSE; + int increment_notification_number=FALSE,tmp; /* clear volatile macros */ clear_volatile_macros(); @@ -1088,7 +1088,7 @@ int host_notification(host *hst, int typ /* set the notification number macro */ my_free(macro_x[MACRO_HOSTNOTIFICATIONNUMBER]); - asprintf(¯o_x[MACRO_HOSTNOTIFICATIONNUMBER],"%d",hst->current_notification_number); + tmp=asprintf(¯o_x[MACRO_HOSTNOTIFICATIONNUMBER],"%d",hst->current_notification_number); /* the $NOTIFICATIONNUMBER$ macro is maintained for backward compatability */ my_free(macro_x[MACRO_NOTIFICATIONNUMBER]); @@ -1096,7 +1096,7 @@ int host_notification(host *hst, int typ /* set the notification id macro */ my_free(macro_x[MACRO_HOSTNOTIFICATIONID]); - asprintf(¯o_x[MACRO_HOSTNOTIFICATIONID],"%lu",hst->current_notification_id); + tmp=asprintf(¯o_x[MACRO_HOSTNOTIFICATIONID],"%lu",hst->current_notification_id); /* notify each contact (duplicates have been removed) */ for(temp_notification=notification_list;temp_notification!=NULL;temp_notification=temp_notification->next){ @@ -1511,7 +1511,7 @@ int notify_contact_of_host(contact *cntc struct timeval method_start_time; struct timeval method_end_time; int macro_options=STRIP_ILLEGAL_MACRO_CHARS|ESCAPE_MACRO_CHARS; - + int tmp; log_debug_info(DEBUGL_FUNCTIONS,0,"notify_contact_of_host()\n"); log_debug_info(DEBUGL_NOTIFICATIONS,2,"** Attempting to notifying contact '%s'...\n",cntct->name); @@ -1570,31 +1570,31 @@ int notify_contact_of_host(contact *cntc if(log_notifications==TRUE){ switch(type){ case NOTIFICATION_CUSTOM: - asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;CUSTOM ($HOSTSTATE$);%s;$HOSTOUTPUT$;$NOTIFICATIONAUTHOR$;$NOTIFICATIONCOMMENT$\n",cntct->name,hst->name,command_name_ptr); + tmp=asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;CUSTOM ($HOSTSTATE$);%s;$HOSTOUTPUT$;$NOTIFICATIONAUTHOR$;$NOTIFICATIONCOMMENT$\n",cntct->name,hst->name,command_name_ptr); break; case NOTIFICATION_ACKNOWLEDGEMENT: - asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;ACKNOWLEDGEMENT ($HOSTSTATE$);%s;$HOSTOUTPUT$;$NOTIFICATIONAUTHOR$;$NOTIFICATIONCOMMENT$\n",cntct->name,hst->name,command_name_ptr); + tmp=asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;ACKNOWLEDGEMENT ($HOSTSTATE$);%s;$HOSTOUTPUT$;$NOTIFICATIONAUTHOR$;$NOTIFICATIONCOMMENT$\n",cntct->name,hst->name,command_name_ptr); break; case NOTIFICATION_FLAPPINGSTART: - asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;FLAPPINGSTART ($HOSTSTATE$);%s;$HOSTOUTPUT$\n",cntct->name,hst->name,command_name_ptr); + tmp=asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;FLAPPINGSTART ($HOSTSTATE$);%s;$HOSTOUTPUT$\n",cntct->name,hst->name,command_name_ptr); break; case NOTIFICATION_FLAPPINGSTOP: - asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;FLAPPINGSTOP ($HOSTSTATE$);%s;$HOSTOUTPUT$\n",cntct->name,hst->name,command_name_ptr); + tmp=asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;FLAPPINGSTOP ($HOSTSTATE$);%s;$HOSTOUTPUT$\n",cntct->name,hst->name,command_name_ptr); break; case NOTIFICATION_FLAPPINGDISABLED: - asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;FLAPPINGDISABLED ($HOSTSTATE$);%s;$HOSTOUTPUT$\n",cntct->name,hst->name,command_name_ptr); + tmp=asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;FLAPPINGDISABLED ($HOSTSTATE$);%s;$HOSTOUTPUT$\n",cntct->name,hst->name,command_name_ptr); break; case NOTIFICATION_DOWNTIMESTART: - asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;DOWNTIMESTART ($HOSTSTATE$);%s;$HOSTOUTPUT$\n",cntct->name,hst->name,command_name_ptr); + tmp=asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;DOWNTIMESTART ($HOSTSTATE$);%s;$HOSTOUTPUT$\n",cntct->name,hst->name,command_name_ptr); break; case NOTIFICATION_DOWNTIMEEND: - asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;DOWNTIMEEND ($HOSTSTATE$);%s;$HOSTOUTPUT$\n",cntct->name,hst->name,command_name_ptr); + tmp=asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;DOWNTIMEEND ($HOSTSTATE$);%s;$HOSTOUTPUT$\n",cntct->name,hst->name,command_name_ptr); break; case NOTIFICATION_DOWNTIMECANCELLED: - asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;DOWNTIMECANCELLED ($HOSTSTATE$);%s;$HOSTOUTPUT$\n",cntct->name,hst->name,command_name_ptr); + tmp=asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;DOWNTIMECANCELLED ($HOSTSTATE$);%s;$HOSTOUTPUT$\n",cntct->name,hst->name,command_name_ptr); break; default: - asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;$HOSTSTATE$;%s;$HOSTOUTPUT$\n",cntct->name,hst->name,command_name_ptr); + tmp=asprintf(&temp_buffer,"HOST NOTIFICATION: %s;%s;$HOSTSTATE$;%s;$HOSTOUTPUT$\n",cntct->name,hst->name,command_name_ptr); break; } @@ -1725,7 +1725,7 @@ int create_notification_list_from_host(h contact *temp_contact=NULL; contactgroupsmember *temp_contactgroupsmember=NULL; contactgroup *temp_contactgroup=NULL; - int escalate_notification=FALSE; + int escalate_notification=FALSE,tmp; void *ptr=NULL; log_debug_info(DEBUGL_FUNCTIONS,0,"create_notification_list_from_host()\n"); @@ -1738,7 +1738,7 @@ int create_notification_list_from_host(h /* set the escalation macro */ my_free(macro_x[MACRO_NOTIFICATIONISESCALATED]); - asprintf(¯o_x[MACRO_NOTIFICATIONISESCALATED],"%d",escalate_notification); + tmp=asprintf(¯o_x[MACRO_NOTIFICATIONISESCALATED],"%d",escalate_notification); if(options & NOTIFICATION_OPTION_BROADCAST) log_debug_info(DEBUGL_NOTIFICATIONS,1,"This notification will be BROADCAST to all (escalated and normal) contacts...\n"); --- nagios-3.0.6/base/utils.c.p11 2008-12-01 03:22:58 +1000 +++ nagios-3.0.6/base/utils.c 2009-01-12 10:19:30 +1000 @@ -298,8 +298,8 @@ int my_system(char *cmd,int timeout,int #ifdef EMBEDDEDPERL char fname[512]=""; char *args[5]={"",DO_CLEAN, "", "", NULL }; - SV *plugin_hndlr_cr; - STRLEN n_a ; + SV *plugin_hndlr_cr=NULL; + /* STRLEN n_a ; */ char *perl_output=NULL; int count; int use_epn=FALSE; @@ -308,7 +308,7 @@ int my_system(char *cmd,int timeout,int #endif dSP; #endif - + int tmp; log_debug_info(DEBUGL_FUNCTIONS,0,"my_system()\n"); @@ -367,7 +367,7 @@ int my_system(char *cmd,int timeout,int */ (void) POPs ; - asprintf(&temp_buffer,"%s", SvPVX(ERRSV)); + tmp=asprintf(&temp_buffer,"%s", SvPVX(ERRSV)); log_debug_info(DEBUGL_COMMANDS,0,"Embedded perl failed to compile %s, compile error %s\n",fname,temp_buffer); @@ -390,7 +390,7 @@ int my_system(char *cmd,int timeout,int #endif /* create a pipe */ - pipe(fd); + tmp=pipe(fd); /* make the pipe non-blocking */ fcntl(fd[0],F_SETFL,O_NONBLOCK); @@ -479,7 +479,7 @@ int my_system(char *cmd,int timeout,int log_debug_info(DEBUGL_COMMANDS,0,"Embedded perl ran command %s with output %d, %s\n",fname,status,buffer); /* write the output back to the parent process */ - write(fd[1],buffer,strlen(buffer)+1); + tmp=write(fd[1],buffer,strlen(buffer)+1); /* close pipe for writing */ close(fd[1]); @@ -503,7 +503,7 @@ int my_system(char *cmd,int timeout,int buffer[sizeof(buffer)-1]='\x0'; /* write the error back to the parent process */ - write(fd[1],buffer,strlen(buffer)+1); + tmp=write(fd[1],buffer,strlen(buffer)+1); result=STATE_CRITICAL; } @@ -511,7 +511,7 @@ int my_system(char *cmd,int timeout,int /* write all the lines of output back to the parent process */ while(fgets(buffer,sizeof(buffer)-1,fp)) - write(fd[1],buffer,strlen(buffer)); + tmp=write(fd[1],buffer,strlen(buffer)); /* close the command and get termination status */ status=pclose(fp); @@ -1959,7 +1959,7 @@ int daemon_init(void){ char buf[256]; struct flock lock; char *homedir=NULL; - + int tmp; #ifdef RLIMIT_CORE struct rlimit limit; #endif @@ -1967,9 +1967,9 @@ int daemon_init(void){ /* change working directory. scuttle home if we're dumping core */ homedir=getenv("HOME"); if(daemon_dumps_core==TRUE && homedir!=NULL) - chdir(homedir); + tmp=chdir(homedir); else - chdir("/"); + tmp=chdir("/"); umask(S_IWGRP|S_IWOTH); @@ -2046,9 +2046,9 @@ int daemon_init(void){ /* write PID to lockfile... */ lseek(lockfile,0,SEEK_SET); - ftruncate(lockfile,0); + tmp=ftruncate(lockfile,0); sprintf(buf,"%d\n",(int)getpid()); - write(lockfile,buf,strlen(buf)); + tmp=write(lockfile,buf,strlen(buf)); /* make sure lock file stays open while program is executing... */ val=fcntl(lockfile,F_GETFD,0); @@ -2178,13 +2178,13 @@ int move_check_result_to_queue(char *che int output_file_fd=-1; mode_t new_umask=077; mode_t old_umask; - int result=0; + int result=0,tmp; /* save the file creation mask */ old_umask=umask(new_umask); /* create a safe temp file */ - asprintf(&output_file,"%s/cXXXXXX",check_result_path); + tmp=asprintf(&output_file,"%s/cXXXXXX",check_result_path); output_file_fd=mkstemp(output_file); /* file created okay */ @@ -2207,7 +2207,7 @@ int move_check_result_to_queue(char *che #endif /* create an ok-to-go indicator file */ - asprintf(&temp_buffer,"%s.ok",output_file); + tmp=asprintf(&temp_buffer,"%s.ok",output_file); if((output_file_fd=open(temp_buffer,O_CREAT|O_WRONLY|O_TRUNC,S_IRUSR|S_IWUSR))>0) close(output_file_fd); my_free(temp_buffer); @@ -2243,7 +2243,7 @@ int process_check_result_queue(char *dir struct stat stat_buf; struct stat ok_stat_buf; char *temp_buffer=NULL; - int result=OK; + int result=OK,tmp; /* make sure we have what we need */ if(dirname==NULL){ @@ -2292,7 +2292,7 @@ int process_check_result_queue(char *dir /* at this point we have a regular file... */ /* can we find the associated ok-to-go file ? */ - asprintf(&temp_buffer,"%s.ok",file); + tmp=asprintf(&temp_buffer,"%s.ok",file); result=stat(temp_buffer,&ok_stat_buf); my_free(temp_buffer); if(result==-1) @@ -2319,7 +2319,7 @@ int process_check_result_queue(char *dir /* reads check result(s) from a file */ int process_check_result_file(char *fname){ mmapfile *thefile=NULL; - char *temp_buffer=NULL; + /* char *temp_buffer=NULL; */ char *input=NULL; char *var=NULL; char *val=NULL; @@ -2494,12 +2494,12 @@ int process_check_result_file(char *fnam /* deletes as check result file, as well as its ok-to-go file */ int delete_check_result_file(char *fname){ char *temp_buffer=NULL; - + int tmp; /* delete the result file */ unlink(fname); /* delete the ok-to-go file */ - asprintf(&temp_buffer,"%s.ok",fname); + tmp=asprintf(&temp_buffer,"%s.ok",fname); unlink(temp_buffer); my_free(temp_buffer); @@ -3212,11 +3212,11 @@ int compare_hashdata(const char *val1a, /* renames a file - works across filesystems (Mike Wiacek) */ int my_rename(char *source, char *dest){ - char buffer[MAX_INPUT_BUFFER]={0}; + /* char buffer[MAX_INPUT_BUFFER]={0}; */ int rename_result=0; - int source_fd=-1; - int dest_fd=-1; - int bytes_read=0; + /* int source_fd=-1; */ + /* int dest_fd=-1; */ + /* int bytes_read=0; */ /* make sure we have something */ @@ -3263,7 +3263,7 @@ int my_fcopy(char *source, char *dest){ int source_fd=-1; int dest_fd=-1; int bytes_read=0; - + int tmp; /* make sure we have something */ if(source==NULL || dest==NULL) @@ -3280,7 +3280,7 @@ int my_fcopy(char *source, char *dest){ /* copy file contents */ while((bytes_read=read(source_fd,buffer,sizeof(buffer)))>0) - write(dest_fd,buffer,bytes_read); + tmp=write(dest_fd,buffer,bytes_read); close(source_fd); close(dest_fd); @@ -3599,7 +3599,7 @@ int init_embedded_perl(char **env){ #ifdef EMBEDDEDPERL char *embedding[]={ "", "" }; int exitstatus=0; - char *temp_buffer=NULL; + /* char *temp_buffer=NULL; */ int argc=2; struct stat stat_buf; @@ -3667,7 +3667,7 @@ int file_uses_embedded_perl(char *fname) char linen[80]=""; int line=0; char *ptr=NULL; - int found_epn_directive=FALSE; + int found_epn_directive=FALSE,tmp; if(enable_embedded_perl==TRUE){ @@ -3676,7 +3676,7 @@ int file_uses_embedded_perl(char *fname) if(fp!=NULL){ /* grab the first line - we should see Perl */ - fgets(line1,80,fp); + tmp=(int)fgets(line1,80,fp); /* yep, its a Perl script... */ if(strstr(line1,"/bin/perl")!=NULL){ @@ -3984,7 +3984,7 @@ int submit_external_command(char *cmd, i /* submits a raw external command (without timestamp) for processing */ int submit_raw_external_command(char *cmd, time_t *ts, int *buffer_items){ char *newcmd=NULL; - int result=OK; + int result=OK,tmp; time_t timestamp; if(cmd==NULL) @@ -3997,7 +3997,7 @@ int submit_raw_external_command(char *cm time(×tamp); /* create the command string */ - asprintf(&newcmd,"[%lu] %s",(unsigned long)timestamp,cmd); + tmp=asprintf(&newcmd,"[%lu] %s",(unsigned long)timestamp,cmd); /* submit the command */ result=submit_external_command(newcmd,buffer_items); --- nagios-3.0.6/cgi/cgiauth.c.p11 2008-12-01 04:13:11 +1000 +++ nagios-3.0.6/cgi/cgiauth.c 2009-01-12 10:19:30 +1000 @@ -44,7 +44,7 @@ int get_authentication_information(authd mmapfile *thefile; char *input=NULL; char *temp_ptr; - int needed_options; + /* int needed_options; */ if(authinfo==NULL) return ERROR; --- nagios-3.0.6/cgi/extinfo.c.p11 2008-12-01 03:22:58 +1000 +++ nagios-3.0.6/cgi/extinfo.c 2009-01-12 10:19:30 +1000 @@ -1016,7 +1016,7 @@ void show_host_info(void){ time_t current_time; time_t t; int duration_error=FALSE; - + int tmp; /* get host info */ temp_host=find_host(host_name); @@ -1105,7 +1105,7 @@ void show_host_info(void){ printf("