[Pkg-nagios-changes] [pkg-mod-gearman] 04/48: Revert "Macro escaping: Escape macros in command lines as macros should"

Stig Sandbeck Mathisen ssm at debian.org
Sun Nov 24 22:38:08 UTC 2013


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository pkg-mod-gearman.

commit 2de3a9032360b1af6515b47a01eac3cff7c712c2
Author: Sven Nierlein <sven at nierlein.de>
Date:   Mon Aug 5 11:33:44 2013 +0200

    Revert "Macro escaping: Escape macros in command lines as macros should"
    
    This reverts commit cdbf3cd7c28d70161f86b35a69a477defb0d2879.
    
    There is no need to remove illegal chars for host and service checks. In fact, there
    are no illegal chars because there is no external input for the command line of
    normal checks.
---
 neb_module/mod_gearman.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/neb_module/mod_gearman.c b/neb_module/mod_gearman.c
index 66d2196..f524e86 100644
--- a/neb_module/mod_gearman.c
+++ b/neb_module/mod_gearman.c
@@ -491,7 +491,6 @@ static int handle_host_check( int event_type, void *data ) {
     struct timeval core_time;
     struct tm next_check;
     char buffer1[GM_BUFFERSIZE];
-    int macro_options = STRIP_ILLEGAL_MACRO_CHARS | ESCAPE_MACRO_CHARS;
 
     gettimeofday(&core_time,NULL);
 
@@ -555,14 +554,14 @@ static int handle_host_check( int event_type, void *data ) {
     grab_host_macros(hst);
 
     /* get the raw command line */
-    get_raw_command_line(hst->check_command_ptr,hst->host_check_command,&raw_command,macro_options);
+    get_raw_command_line(hst->check_command_ptr,hst->host_check_command,&raw_command,0);
     if(raw_command==NULL){
         gm_log( GM_LOG_ERROR, "Raw check command for host '%s' was NULL - aborting.\n",hst->name );
         return NEBERROR_CALLBACKCANCEL;
     }
 
     /* process any macros contained in the argument */
-    process_macros(raw_command,&processed_command,macro_options);
+    process_macros(raw_command,&processed_command,0);
     if(processed_command==NULL){
         gm_log( GM_LOG_ERROR, "Processed check command for host '%s' was NULL - aborting.\n",hst->name);
         return NEBERROR_CALLBACKCANCEL;
@@ -665,7 +664,6 @@ static int handle_svc_check( int event_type, void *data ) {
     struct timeval core_time;
     struct tm next_check;
     char buffer1[GM_BUFFERSIZE];
-    int macro_options = STRIP_ILLEGAL_MACRO_CHARS | ESCAPE_MACRO_CHARS;
 
     gettimeofday(&core_time,NULL);
 
@@ -725,14 +723,14 @@ static int handle_svc_check( int event_type, void *data ) {
     grab_service_macros(svc);
 
     /* get the raw command line */
-    get_raw_command_line(svc->check_command_ptr,svc->service_check_command,&raw_command,macro_options);
+    get_raw_command_line(svc->check_command_ptr,svc->service_check_command,&raw_command,0);
     if(raw_command==NULL){
         gm_log( GM_LOG_ERROR, "Raw check command for service '%s' on host '%s' was NULL - aborting.\n", svc->description, svc->host_name );
         return NEBERROR_CALLBACKCANCEL;
     }
 
     /* process any macros contained in the argument */
-    process_macros(raw_command, &processed_command, macro_options);
+    process_macros(raw_command, &processed_command, 0);
     if(processed_command==NULL) {
         gm_log( GM_LOG_ERROR, "Processed check command for service '%s' on host '%s' was NULL - aborting.\n", svc->description, svc->host_name);
         my_free(raw_command);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-mod-gearman



More information about the Pkg-nagios-changes mailing list