Code

contrib/collection3: skip host dirs without read access.
authorMarc Fournier <marc.fournier@camptocamp.com>
Wed, 16 Sep 2009 10:17:28 +0000 (12:17 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Wed, 16 Sep 2009 20:35:00 +0000 (22:35 +0200)
This patch prevents get_files_from_directory() from
failing when DataDir contains directories which we
don't have access to.

An example would be "lost+found" directories, on
ext2/ext3 filesystems, which belong to root and have
0700 filemode.

Signed-off-by: Marc Fournier <marc.fournier@camptocamp.com>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
contrib/collection3/lib/Collectd/Graph/Common.pm

index 6019edb4f633aee14e37fd138631bfe6105ddbc2..f88c22b5420aeb9e961c208dc688b6f9f463f8e0 100644 (file)
@@ -265,6 +265,7 @@ sub get_all_hosts
   {
     next if ($entry =~ m/^\./);
     next if (!-d "$data_dir/$entry");
+    next if (!-r "$data_dir/$entry" or !-x "$data_dir/$entry");
     push (@ret, sanitize_hostname ($entry));
   }
   closedir ($dh);