Changeset 50

Show
Ignore:
Timestamp:
11/30/06 01:27:41 (2 years ago)
Author:
kindlund
Message:

testing patch to integrity cod

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • honeyclient/branches/bug/42/lib/HoneyClient/Agent/Integrity.pm

    r35 r50  
    166166use Storable qw(dclone); 
    167167use Data::Dumper; 
     168use File::Basename qw(dirname); 
    168169 
    169170BEGIN { 
     
    521522                                # because you can't get to that in _found() 
    522523        } 
    523         else { if(-d  $file){ 
    524                 find (\&_recursive_exclude, $file); 
    525             } 
    526             else{ 
    527                 #XXX: Does this case matter(exist?) for pipes for instance? 
    528                 print "A file that isn't a file or directory (or just general problem, or the file just isn't there) was found with file: $file\n"; 
    529             } 
     524        elsif(-d $file){ 
     525            print "excluding $file\n"; 
     526            $g_ex_hash->{$file} = 1;    #used in lieu of the $self->file_exclude_hash 
     527            #find (\&_recursive_exclude, $file); 
     528        } 
     529        else{ 
     530            #XXX: Does this case matter(exist?) for pipes for instance? 
     531            print "A file that isn't a file or directory (or just general problem, or the file just isn't there) was found with file: $file\n"; 
    530532        } 
    531533    } 
     
    800802    my $foundfile = $File::Find::name; 
    801803    if (-f $foundfile) { 
    802         if(!exists($g_ex_hash->{$foundfile})) { 
     804        if (exists($g_ex_hash->{$foundfile})) { 
     805            return; 
     806        } 
     807 
     808        my $dir = dirname($foundfile); 
     809        while ($dir ne "/") { 
     810            if (exists($g_ex_hash->{$dir})) { 
     811                return; 
     812            } 
     813            $dir = dirname($dir); 
     814        } 
     815 
     816#       if (!exists($g_ex_hash->{$foundfile})) { 
    803817            push @{$g_hack}, $foundfile; 
    804818#           print "found $foundfile\n"; 
    805819#           print "@{$g_hack}\n"; 
    806       } 
     820#     } 
    807821    } 
    808822}