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

check_file_age does not handle filenames with space

Fix for issue https://github.com/nagios-plugins/nagios-plugins/issues/178

The fix for issue #155 (allow wildcard matching) was to use `glob`, which
worked fine for `*` or filenames without spaces. Adding surrounding quotes
makes it work for all cases.
John C. Frickson 9 лет назад
Родитель
Сommit
d8a41bb077
2 измененных файлов с 3 добавлено и 0 удалено
  1. 1 0
      NEWS
  2. 2 0
      plugins-scripts/check_file_age.pl

+ 1 - 0
NEWS

@@ -9,6 +9,7 @@ This file documents the major additions and syntax changes between releases.
 	check_dns: Update IF_RECORD to not erase query_found
 	check_http: SSL Certificate check returns 12:00:00AM <local timezone>
 	check_http: -u is misleading. Changed help text
+	check_file_age: does not handle filenames with space
 
 
 2.1.3 2016-09-12

+ 2 - 0
plugins-scripts/check_file_age.pl

@@ -77,6 +77,8 @@ if (! $opt_f) {
 	exit $ERRORS{'UNKNOWN'};
 }
 
+$opt_f = '"' . $opt_f . '"';
+
 # Check that file(s) exists (can be directory or link)
 $perfdata = "";
 $output = "";