From 81207a4725755b4df70c2d329225f118475f0253 Mon Sep 17 00:00:00 2001 From: Marc Fournier Date: Wed, 16 Sep 2009 12:17:28 +0200 Subject: [PATCH] contrib/collection3: skip host dirs without read access. 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 Signed-off-by: Florian Forster --- contrib/collection3/lib/Collectd/Graph/Common.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/collection3/lib/Collectd/Graph/Common.pm b/contrib/collection3/lib/Collectd/Graph/Common.pm index 6019edb4..f88c22b5 100644 --- a/contrib/collection3/lib/Collectd/Graph/Common.pm +++ b/contrib/collection3/lib/Collectd/Graph/Common.pm @@ -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); -- 2.11.0