dsa-check-libs: Ignore deleted directories that we happen to be in
authorPeter Palfrader <peter@palfrader.org>
Wed, 18 Feb 2015 11:13:17 +0000 (12:13 +0100)
committerPeter Palfrader <peter@palfrader.org>
Wed, 18 Feb 2015 11:13:17 +0000 (12:13 +0100)
modules/nagios/files/dsa-check-libs

index 5d49855..87a886d 100755 (executable)
@@ -172,6 +172,7 @@ LINE: for my $line (@lsof)  {
        if ($path =~ m/\.dpkg-/ || $path =~ m/\(deleted\)/ || $path =~ /path inode=/ || $path =~ m#/\.nfs# || $fd eq 'DEL') {
                my $deleted_in_path = ($path =~ m/\(deleted\)/);
                next if ($deleted_in_path && $fd =~ /^[0-9]*$/); # Ignore deleted files that are open via normal file handles.
+               next if ($deleted_in_path && $fd eq 'cwd'); # Ignore deleted directories that we happen to be in.
 
                $path =~ s/^\(deleted\)//; # in some cases "(deleted)" is at the beginning of the string
                for my $i (@{$config->{'ignorelist'}}) {