[Pkg-nagios-changes] [pkg-nagios] r1681 - nagios-nrpe/trunk/debian/patches
Alexander Wirt
formorer at alioth.debian.org
Mon Jul 6 08:22:38 UTC 2009
Author: formorer
Date: 2009-07-06 08:22:36 +0000 (Mon, 06 Jul 2009)
New Revision: 1681
Modified:
nagios-nrpe/trunk/debian/patches/05_pid_privileges.dpatch
Log:
Fix pidfile creation
Modified: nagios-nrpe/trunk/debian/patches/05_pid_privileges.dpatch
===================================================================
--- nagios-nrpe/trunk/debian/patches/05_pid_privileges.dpatch 2009-07-06 07:47:27 UTC (rev 1680)
+++ nagios-nrpe/trunk/debian/patches/05_pid_privileges.dpatch 2009-07-06 08:22:36 UTC (rev 1681)
@@ -6,13 +6,22 @@
@DPATCH@
diff -urNad nagios-nrpe-2.12~/src/nrpe.c nagios-nrpe-2.12/src/nrpe.c
---- nagios-nrpe-2.12~/src/nrpe.c 2008-03-10 22:04:43.000000000 +0100
-+++ nagios-nrpe-2.12/src/nrpe.c 2008-09-14 21:29:53.000000000 +0200
-@@ -1610,6 +1610,7 @@
- }
+--- nagios-nrpe-2.12~/src/nrpe.c 2009-07-06 10:20:37.000000000 +0200
++++ nagios-nrpe-2.12/src/nrpe.c 2009-07-06 10:22:00.000000000 +0200
+@@ -296,12 +296,13 @@
+ /* log info to syslog facility */
+ syslog(LOG_NOTICE,"Starting up daemon");
- /* write new pid file */
-+ unlink(pid_file);
- if((fd=open(pid_file,O_WRONLY | O_CREAT,0644))>=0){
- sprintf(pbuf,"%d\n",(int)getpid());
- write(fd,pbuf,strlen(pbuf));
++
++ /* drop privileges */
++ drop_privileges(nrpe_user,nrpe_group);
++
+ /* write pid file */
+ if(write_pid_file()==ERROR)
+ return STATE_CRITICAL;
+-
+- /* drop privileges */
+- drop_privileges(nrpe_user,nrpe_group);
+
+ /* make sure we're not root */
+ check_privileges();
More information about the Pkg-nagios-changes
mailing list