From 5ff53ebce08d55bd489be8613fa0f0d719251eb4 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 7 Jun 2016 21:37:33 -0400 Subject: [PATCH] More output on errors, make them non-fatal --- scripts/zmaudit.pl.in | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/zmaudit.pl.in b/scripts/zmaudit.pl.in index 6dbf739e5..37c399638 100644 --- a/scripts/zmaudit.pl.in +++ b/scripts/zmaudit.pl.in @@ -197,14 +197,20 @@ MAIN: while( $loop ) { my $fs_events = $fs_monitors->{$monitor} = {}; # De-taint ( my $monitor_dir ) = ( $monitor =~ /^(.*)$/ ); + if ( $Config{ZM_USE_DEEP_STORAGE} ) { foreach my $day_dir ( glob("$monitor_dir/*/*/*") ) { Debug( "Checking $day_dir" ); ( $day_dir ) = ( $day_dir =~ /^(.*)$/ ); # De-taint - chdir( $day_dir ); - opendir( DIR, "." ) - or Fatal( "Can't open directory '$day_dir': $!" ); + if ( ! chdir( $day_dir ) ) { + Error( "Can't chdir to $$Storage{Path}/$monitor_dir/'$day_dir': $!" ); + next; + } + if ( ! opendir( DIR, "." ) ) { + Error( "Can't open directory $$Storage{Path}/$monitor_dir/'$day_dir': $!" ); + next; + } my @event_links = sort { $b <=> $a } grep { -l $_ } readdir( DIR ); closedir( DIR ); my $count = 0;