Changeset 348
- Timestamp:
- 05/07/07 16:56:17 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
honeyclient/branches/exp/kindlund-filesystem/etc/honeyclient.xml
r340 r348 402 402 </port> 403 403 <datastore_path description="The absolute path to the parent directory, where all HoneyClient VM data is stored on the host server. It is assumed that individual VM data is stored in separate subdirectories within this parent directory." default="/vm"> 404 /vm 404 /vm/clones 405 405 </datastore_path> 406 406 <snapshot_path description="The absolute path to the directory that contains all snapshot data, associated with every HoneyClient VM." default="/vm/snapshots"> honeyclient/branches/exp/kindlund-filesystem/lib/HoneyClient/Agent.pm
r347 r348 568 568 # When called from run(), this function takes in the corresponding 569 569 # Driver object; checks to see if there's a new entry within the 570 # driver's corresponding update queue; and dequeues the * first*571 # entr yin the queue, overwriting the Driver's state data570 # driver's corresponding update queue; and dequeues the *all* 571 # entries in the queue, overwriting the Driver's state data 572 572 # accordingly. 573 573 # 574 574 # The external updateState() call adds new driver state into the queue, 575 575 # one entry per call. The internal _update() function merges this 576 # driver state with the currently running driver, one merge577 # operationper call. In order words, a single call to _update()578 # may *NOT* empty the corresponding Driver update queue completely579 # -- only one entrywithin the queue will be dequeued per _update()576 # driver state with the currently running driver, merging everything 577 # queued per call. In order words, a single call to _update() 578 # *WILL* empty the corresponding Driver update queue completely 579 # -- all entries within the queue will be dequeued per _update() 580 580 # call made. 581 581 # … … 593 593 my $queue = $driverUpdateQueues{$driverName}; 594 594 595 # XXX: One possible DoS condition here; what if 596 # the manager keeps feeding updates to the Agent 597 # before the Agent has a chance to do any work? 598 595 599 # If we have data in our driver specific queue... 596 if($queue->pending) {600 while ($queue->pending) { 597 601 598 602 # Update our driver state with the first entry … … 849 853 $data->{$driverName}->{'state'} = $driver; 850 854 851 if ($driver->isFinished() or $driverTargetsChanged) {852 # Thread is about to finish, set the ID back to undef.853 # This looks ugly, but setting it this early avoids the854 # potential race condition of when the run() thread is finished855 # and when updateState() checks for $driverData->{$driverName}->{'thread_id'}856 # to be set to undef.857 $data->{$driverName}->{'thread_id'} = undef;858 }859 860 855 # Release lock on stored driver state. 861 856 _unlock($data); … … 863 858 864 859 # TODO: Perform Integrity Check 860 my $isCompromised = 0; 865 861 if (defined($integrity)) { 866 862 # For now, we update a scalar called 'is_compromised' within … … 871 867 scalar(@{$changes->{filesystem}})) { 872 868 print "Integrity Check: FAILED\n"; 873 874 # Acquire lock on stored driver state. 875 $data = _lock(); 876 877 $data->{$driverName}->{'status'}->{'is_compromised'} = 1; 878 879 # Release lock on stored driver state. 880 _unlock($data); 881 869 $isCompromised = 1; 882 870 } else { 883 871 print "Integrity Check: PASSED\n"; … … 888 876 # DESTROY this reference, but don't kill any temporary files created. 889 877 $integrity = undef; 878 879 # Update driver state one last time, before exiting. 880 881 # Acquire lock on stored driver state. 882 $data = _lock(); 883 884 # Check for any additional external driver updates. 885 $driver = _update($driver); 886 887 # Copy object data to shared memory. 888 $data->{$driverName}->{'next'} = $driver->next(); 889 $data->{$driverName}->{'status'} = $driver->status(); 890 $data->{$driverName}->{'status'}->{'is_compromised'} = $isCompromised; 891 $data->{$driverName}->{'state'} = $driver; 892 893 # Thread is about to finish, set the ID back to undef. 894 $data->{$driverName}->{'thread_id'} = undef; 895 896 # Release lock on stored driver state. 897 _unlock($data); 890 898 891 899 # XXX: Debugging, remove eventually.
