[Nagios-checkins] nagios/base nagios.c,1.72,1.73 nebmods.c,1.6,1.7 utils.c,1.98,1.99
Nagios network monitoring software is enterprise server monitoring
Brought to you by:
egalstad,
sawolf-nagios
From: Ethan G. <ega...@us...> - 2005-03-25 00:04:45
|
Update of /cvsroot/nagios/nagios/base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29456/base Modified Files: nagios.c nebmods.c utils.c Log Message: Nagios now aborts if it can't drop privileges Index: nebmods.c =================================================================== RCS file: /cvsroot/nagios/nagios/base/nebmods.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** nebmods.c 20 Dec 2004 05:23:34 -0000 1.6 --- nebmods.c 25 Mar 2005 00:04:19 -0000 1.7 *************** *** 3,8 **** * NEBMODS.C - Event Broker Module Functions * ! * Copyright (c) 2002-2004 Ethan Galstad (na...@na...) ! * Last Modified: 12-19-2004 * * License: --- 3,8 ---- * NEBMODS.C - Event Broker Module Functions * ! * Copyright (c) 2002-2005 Ethan Galstad (na...@na...) ! * Last Modified: 03-24-2005 * * License: *************** *** 536,539 **** --- 536,542 ---- int x; + if(neb_callback_list==NULL) + return OK; + for(x=0;x<NEBCALLBACK_NUMITEMS;x++){ Index: nagios.c =================================================================== RCS file: /cvsroot/nagios/nagios/base/nagios.c,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** nagios.c 11 Mar 2005 22:31:03 -0000 1.72 --- nagios.c 25 Mar 2005 00:04:19 -0000 1.73 *************** *** 495,499 **** /* drop privileges */ ! drop_privileges(nagios_user,nagios_group); #ifdef USE_EVENT_BROKER --- 495,507 ---- /* drop privileges */ ! if(drop_privileges(nagios_user,nagios_group)==ERROR){ ! ! snprintf(buffer,sizeof(buffer),"Failed to drop privileges. Aborting."); ! buffer[sizeof(buffer)-1]='\x0'; ! write_to_logs_and_console(buffer,NSLOG_PROCESS_INFO | NSLOG_RUNTIME_ERROR | NSLOG_CONFIG_ERROR,TRUE); ! ! cleanup(); ! exit(ERROR); ! } #ifdef USE_EVENT_BROKER Index: utils.c =================================================================== RCS file: /cvsroot/nagios/nagios/base/utils.c,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** utils.c 23 Mar 2005 22:06:39 -0000 1.98 --- utils.c 25 Mar 2005 00:04:19 -0000 1.99 *************** *** 4,8 **** * * Copyright (c) 1999-2005 Ethan Galstad (na...@na...) ! * Last Modified: 03-23-2005 * * License: --- 4,8 ---- * * Copyright (c) 1999-2005 Ethan Galstad (na...@na...) ! * Last Modified: 03-24-2005 * * License: *************** *** 3580,3583 **** --- 3580,3584 ---- struct group *grp; struct passwd *pw; + int result=OK; #ifdef DEBUG0 *************** *** 3615,3618 **** --- 3616,3620 ---- temp_buffer[sizeof(temp_buffer)-1]='\x0'; write_to_logs_and_console(temp_buffer,NSLOG_RUNTIME_WARNING,TRUE); + result=ERROR; } } *************** *** 3663,3666 **** --- 3665,3669 ---- temp_buffer[sizeof(temp_buffer)-1]='\x0'; write_to_logs_and_console(temp_buffer,NSLOG_RUNTIME_WARNING,TRUE); + result=ERROR; } } *************** *** 3674,3678 **** #endif ! return OK; } --- 3677,3681 ---- #endif ! return result; } |