[icinga-checkins] icinga.org: icinga-core/master: check permissions before calling execv on a command

git at icinga.org git at icinga.org
Mon Jul 19 08:12:53 CEST 2010


Module: icinga-core
Branch: master
Commit: 17b32065bed6ac67c62bc09591cac9368fb7d322
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=17b32065bed6ac67c62bc09591cac9368fb7d322

Author: Christoph Maser <cmr at financial.com>
Date:   Sat Jul  3 22:51:38 2010 +0200

check permissions before calling execv on a command

---

 base/checks.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/base/checks.c b/base/checks.c
index 9f63052..5b80862 100644
--- a/base/checks.c
+++ b/base/checks.c
@@ -838,7 +838,11 @@ int run_async_service_check(service *svc, int check_options, double latency, int
 	                     }
 	 
 	                     log_debug_info(DEBUGL_CHECKS,0,"running process %s via execv\n",processed_command);
-	                     execv(chldargs[0],chldargs);
+                             if (access(chldargs[0], R_OK|X_OK) == 0) {
+	                         execv(chldargs[0],chldargs);
+                             } else {
+                               logit(NSLOG_RUNTIME_WARNING,TRUE,"wrong permissions on plugin %s\n",chldargs[0]);
+                             }
                      	    _exit(EXIT_FAILURE);
 			}
 





More information about the icinga-checkins mailing list