Changeset 385

Show
Ignore:
Timestamp:
05/29/07 11:37:49 (1 year ago)
Author:
kindlund
Message:

Housekeeping.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • honeyclient/branches/exp/kindlund-filesystem/lib/HoneyClient/Agent.pm

    r384 r385  
    164164 
    165165# Make sure Storable loads. 
    166 BEGIN { use_ok('Storable', qw(freeze nfreeze thaw)) or diag("Can't load Storable package.  Check to make sure the package library is correctly listed within the path."); } 
     166BEGIN { use_ok('Storable', qw(freeze nfreeze thaw dclone)) or diag("Can't load Storable package.  Check to make sure the package library is correctly listed within the path."); } 
    167167require_ok('Storable'); 
    168168can_ok('Storable', 'freeze'); 
    169169can_ok('Storable', 'nfreeze'); 
    170170can_ok('Storable', 'thaw'); 
    171 use Storable qw(freeze nfreeze thaw); 
     171can_ok('Storable', 'dclone'); 
     172use Storable qw(freeze nfreeze thaw dclone); 
    172173 
    173174# Make sure MIME::Base64 loads. 
     
    210211 
    211212# Include Hash Serialization Utility Libraries 
    212 # TODO: Update unit tests to include 'dclone' 
    213213use Storable qw(freeze nfreeze thaw dclone); 
    214214$Storable::Deparse = 1; 
     
    241241    getVar(name => "perform_integrity_checks"); 
    242242 
    243 # A globally shared, serialized hashtable, containing the 
    244 # initialized integrity state of the VM -- ready to be checked 
    245 # against, at any time. 
    246 our $integrityState : shared = undef; 
    247  
    248 # XXX: Rename this. 
    249 our $gintegrity; 
     243# A globally shared object, containing the initialized integrity 
     244# state of the VM -- ready to be checked against, at any time after 
     245# initialization. 
     246our $integrityData; 
    250247 
    251248# A globally shared, serialized hashtable, containing data per 
     
    373370 
    374371    # Perform initial integrity baseline check. 
    375     my $integrity = undef; 
    376 # XXX: Disabled temporarily. 
    377372    if ($PERFORM_INTEGRITY_CHECKS) { 
    378 #        require HoneyClient::Agent::Integrity; 
    379         $gintegrity = HoneyClient::Agent::Integrity->new(); 
    380 # XXX: Remove this, eventually. 
    381 print "Gintegrity Init: " . $gintegrity . "\n"; 
    382         $gintegrity->closeFiles(); 
    383         #$integrityState = freeze($integrity); 
    384     } 
    385     # XXX: Check to make sure this doesn't destroy the integrity 
    386     # object prematurely. 
    387     # DESTROY this reference, but don't kill any temporary files created. 
    388     $integrity = undef; 
     373        $integrityData = HoneyClient::Agent::Integrity->new(); 
     374        $integrityData->closeFiles(); 
     375    } 
    389376 
    390377    # Release data lock. 
     
    501488        $driverDataSemaphore  = Thread::Semaphore->new(1); 
    502489        %driverUpdateQueues   = ( ); 
    503         $integrityState       = undef; 
    504  
    505         # TODO: need to set $integrityState to undef 
    506         # and need to call $integrity->destroy, which will call 
     490        $integrityData        = undef; 
     491 
     492        # TODO: 
     493        # need to call $integrityData->destroy, which will call 
    507494        # the registry destroy, which will kill any used temporary 
    508495        # files 
     
    730717                                  { 
    731718                                    'driver_name' => $driverName, 
    732                                     'integrity'   => $gintegrity
     719                                    'integrity'   => $integrityData
    733720                                  } 
    734721                                 );