Просмотр исходного кода

check_nrpe ignores -a option when -f option is specified

Fix for issue #69
John C. Frickson 9 лет назад
Родитель
Сommit
0e596e1170
2 измененных файлов с 7 добавлено и 4 удалено
  1. 1 0
      Changelog
  2. 6 4
      src/check_nrpe.c

+ 1 - 0
Changelog

@@ -13,6 +13,7 @@ FIXES
 - Minor change to logging in check_nrpe (John Frickson)
 - Solaris 11 detection is broken in configure (John Frickson)
 - Removed function `b64_decode` which wasn't being used (John Frickson)
+- check_nrpe ignores -a option when -f option is specified (John Frickson)
 
 
 3.0.1 - 2016-09-08

+ 6 - 4
src/check_nrpe.c

@@ -459,12 +459,14 @@ int process_arguments(int argc, char **argv, int from_config_file)
 	}
 
 	/* determine (base) command query */
-	snprintf(query, sizeof(query), "%s",
-			 (command_name == NULL) ? DEFAULT_NRPE_COMMAND : command_name);
-	query[sizeof(query) - 1] = '\x0';
+	if (!from_config_file) {
+		snprintf(query, sizeof(query), "%s",
+				 (command_name == NULL) ? DEFAULT_NRPE_COMMAND : command_name);
+		query[sizeof(query) - 1] = '\x0';
+	}
 
 	/* get the command args */
-	if (argindex > 0) {
+	if (!from_config_file && argindex > 0) {
 
 		for (c = argindex - 1; c < argc; c++) {