[icinga-checkins] icinga.org: icinga-nrpe/mfriedrich/fixes: * write pid as nrpe user, drop privileges before (Debian patch)

git at icinga.org git at icinga.org
Sat Nov 12 20:54:10 CET 2011


Module: icinga-nrpe
Branch: mfriedrich/fixes
Commit: 9e0e59302239cdb346571daa56ff3b6925fff0b0
URL:    https://git.icinga.org/?p=icinga-nrpe.git;a=commit;h=9e0e59302239cdb346571daa56ff3b6925fff0b0

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Sat Nov 12 20:52:53 2011 +0100

* write pid as nrpe user, drop privileges before (Debian patch)

---

 Changelog  |    1 +
 src/nrpe.c |    6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/Changelog b/Changelog
index 25efa8a..2d962d1 100644
--- a/Changelog
+++ b/Changelog
@@ -22,6 +22,7 @@ FIXES
 * increase help output (Debian patch)
 * do not use /dev/urandom, but a generic seed (Debian patch)
 * null the receive buffer before using it (Debian patch)
+* write pid as nrpe user, drop privileges before (Debian patch)
 
 CHANGES
 
diff --git a/src/nrpe.c b/src/nrpe.c
index 0974813..517ef9c 100644
--- a/src/nrpe.c
+++ b/src/nrpe.c
@@ -312,13 +312,13 @@ int main(int argc, char **argv){
 		/* log info to syslog facility */
 		syslog(LOG_NOTICE,"Starting up daemon");
 
+		/* 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 icinga-checkins mailing list