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

check_disk fails with Permission Denied on fuse.gvfsd-fuse filesystem types

Fix for issue https://github.com/nagios-plugins/nagios-plugins/issues/88
John C. Frickson 9 лет назад
Родитель
Сommit
a4d7343fc9
2 измененных файлов с 6 добавлено и 2 удалено
  1. 1 0
      NEWS
  2. 5 2
      plugins/check_disk.c

+ 1 - 0
NEWS

@@ -3,6 +3,7 @@ This file documents the major additions and syntax changes between releases.
 2.1.x 2016-xx-xx
 	FIXES
 	check_http - Don't include default Accept header if one is provided
+	check_disk - added "fuse.gvfsd-fuse" to list of fs types to ignore
 
 
 2.1.3 2016-09-12

+ 5 - 2
plugins/check_disk.c

@@ -109,6 +109,8 @@ static struct parameter_list *path_select_list = NULL;
 /* Linked list of mounted filesystems. */
 static struct mount_entry *mount_list;
 
+static const char *always_exclude = { "iso9600", "fuse.gvfsd-fuse", NULL };
+
 /* For long options that have no equivalent short option, use a
    non-character as a pseudo short option, starting with CHAR_MAX + 1.  */
 enum
@@ -436,7 +438,7 @@ double calculate_percent(uintmax_t value, uintmax_t total) {
 int
 process_arguments (int argc, char **argv)
 {
-  int c, err;
+  int c, err, i;
   struct parameter_list *se;
   struct parameter_list *temp_list = NULL, *previous = NULL;
   struct parameter_list *temp_path_select_list = NULL;
@@ -492,7 +494,8 @@ process_arguments (int argc, char **argv)
   if (argc < 2)
     return ERROR;
 
-  np_add_name(&fs_exclude_list, "iso9660");
+	for (i = 0; always_exclude[i]; ++i)
+		np_add_name(&fs_exclude_list, always_exclude[i]);
 
   for (c = 1; c < argc; c++)
     if (strcmp ("-to", argv[c]) == 0)